diff options
author | Brad King <brad.king@kitware.com> | 2017-03-22 12:48:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-03-22 12:49:09 (GMT) |
commit | 989484d51fa78f0fc0014212148b52c90872f57e (patch) | |
tree | 8cceb3ea36d2478386c9b31ffd6dfd415c9c1e93 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 053317480a12464d405490502dfde75c5fc17b1f (diff) | |
parent | 075f6454092ae058add228eda8220a3680b2f9e4 (diff) | |
download | CMake-989484d51fa78f0fc0014212148b52c90872f57e.zip CMake-989484d51fa78f0fc0014212148b52c90872f57e.tar.gz CMake-989484d51fa78f0fc0014212148b52c90872f57e.tar.bz2 |
Merge topic 'module-def-and-WINDOWS_EXPORT_ALL_SYMBOLS'
075f6454 Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` files
21c4ec4f cmGlobalVisualStudioGenerator: Simplify __create_def command generation
24361a45 bindexplib: Add support for parsing and integrating `.def` files
845c4824 bindexplib: Add method for parsing and integrating `.def` files
4f90e793 bindexplib: Revise coding style of CMake-specific methods
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !581
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 300618f..cd1407d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -978,7 +978,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // maybe create .def file from list of objects cmGeneratorTarget::ModuleDefinitionInfo const* mdi = gt.GetModuleDefinitionInfo(this->GetConfigName()); - if (mdi && mdi->WindowsExportAllSymbols) { + if (mdi && mdi->DefFileGenerated) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); @@ -987,18 +987,28 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmd += this->GetLocalGenerator()->ConvertToOutputFormat( mdi->DefFile, cmOutputConverter::SHELL); cmd += " "; - cmNinjaDeps objs = this->GetObjects(); std::string obj_list_file = mdi->DefFile + ".objs"; cmd += this->GetLocalGenerator()->ConvertToOutputFormat( obj_list_file, cmOutputConverter::SHELL); preLinkCmdLines.push_back(cmd); + // create a list of obj files for the -E __create_def to read cmGeneratedFileStream fout(obj_list_file.c_str()); - for (cmNinjaDeps::iterator i = objs.begin(); i != objs.end(); ++i) { - if (cmHasLiteralSuffix(*i, ".obj")) { - fout << *i << "\n"; + + if (mdi->WindowsExportAllSymbols) { + cmNinjaDeps objs = this->GetObjects(); + for (cmNinjaDeps::iterator i = objs.begin(); i != objs.end(); ++i) { + if (cmHasLiteralSuffix(*i, ".obj")) { + fout << *i << "\n"; + } } } + + for (std::vector<cmSourceFile const*>::const_iterator i = + mdi->Sources.begin(); + i != mdi->Sources.end(); ++i) { + fout << (*i)->GetFullPath() << "\n"; + } } // If we have any PRE_LINK commands, we need to go back to CMAKE_BINARY_DIR // for |