diff options
author | Brad King <brad.king@kitware.com> | 2015-07-08 13:19:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-07-08 13:19:07 (GMT) |
commit | ad91d0edd5b8e56dc6afffa38e01bcc7d0d265cd (patch) | |
tree | 0568b4d765d56e81590d9b9141346b001c0d0a7d /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | b98574dab2f4fb28c53025c5204cc06ece7de0c2 (diff) | |
parent | 8f86407cfd4331dc1f2eb67f4f179ed8fe9dea06 (diff) | |
download | CMake-ad91d0edd5b8e56dc6afffa38e01bcc7d0d265cd.zip CMake-ad91d0edd5b8e56dc6afffa38e01bcc7d0d265cd.tar.gz CMake-ad91d0edd5b8e56dc6afffa38e01bcc7d0d265cd.tar.bz2 |
Merge topic 'auto_export_dll_symbols'
8f86407c Windows: Optionally generate DLL module definition files automatically
069aa93b bindexplib: Add support for "/bigobj" format objects
61bbbdcf bindexplib: Fix treatment of some symbols
de70c922 bindexplib: Teach DumpFile to return errors
8ea69dfe bindexplib: Build source as part of CMakeLib
2963cb2a bindexplib: Wrap long lines
4ff09893 bindexplib: Drop code that CMake does not need
7de8276c bindexplib: Add copyright/license notice block
65086ad7 bindexplib: Import original implementation from CERN
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 591c2db..a2f9bca 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2466,6 +2466,15 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) "%(IgnoreSpecificDefaultLibraries)"); } + if (this->Target->GetType() == cmTarget::SHARED_LIBRARY && + this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) + { + if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) + { + linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)exportall.def"); + } + } + this->LinkOptions[config] = pOptions.release(); return true; } @@ -2613,8 +2622,25 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() void cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) { - this->WriteEvent("PreLinkEvent", - this->Target->GetPreLinkCommands(), configName); + bool addedPrelink = false; + if (this->Target->GetType() == cmTarget::SHARED_LIBRARY && + this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) + { + if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) + { + addedPrelink = true; + std::vector<cmCustomCommand> commands = + this->Target->GetPreLinkCommands(); + this->GlobalGenerator->AddSymbolExportCommand( + this->GeneratorTarget, commands, configName); + this->WriteEvent("PreLinkEvent", commands, configName); + } + } + if (!addedPrelink) + { + this->WriteEvent("PreLinkEvent", + this->Target->GetPreLinkCommands(), configName); + } this->WriteEvent("PreBuildEvent", this->Target->GetPreBuildCommands(), configName); this->WriteEvent("PostBuildEvent", |