summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-13 12:57:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-13 12:57:20 (GMT)
commitabfc55a362bd2ad5ea45f7f8f228adf516f389ad (patch)
treee7918ba46d47d8ba16cb9f1f381a441979169552 /Source/cmVisualStudio10TargetGenerator.cxx
parentabbc0b839f70354804a222fbb10f96e378927486 (diff)
parentf36eaf6a6eb8a7ef1127ad43e419896be89f0e39 (diff)
downloadCMake-abfc55a362bd2ad5ea45f7f8f228adf516f389ad.zip
CMake-abfc55a362bd2ad5ea45f7f8f228adf516f389ad.tar.gz
CMake-abfc55a362bd2ad5ea45f7f8f228adf516f389ad.tar.bz2
Merge topic 'refactor-module-def'
f36eaf6a Refactor WINDOWS_EXPORT_ALL_SYMBOLS implementation 25d261ef Refactor module definition file selection 1e0a9ac4 Refactor module definition source enumeration Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !570
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx45
1 files changed, 16 insertions, 29 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index fbf7447..4aea6f8 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1841,10 +1841,9 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
(*this->BuildFileStream) << cmVS10EscapeXML(obj) << "\" />\n";
}
- if (cmSourceFile const* defsrc =
- this->GeneratorTarget->GetModuleDefinitionFile("")) {
- this->WriteSource("None", defsrc);
- }
+ std::vector<cmSourceFile const*> defSources;
+ this->GeneratorTarget->GetModuleDefinitionSources(defSources, "");
+ this->WriteSources("None", defSources);
if (this->IsMissingFiles) {
this->WriteMissingFiles();
@@ -2915,24 +2914,15 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
linkOptions.Parse(flags.c_str());
if (this->MSTools) {
- if (cmSourceFile const* defsrc =
- this->GeneratorTarget->GetModuleDefinitionFile("")) {
- linkOptions.AddFlag("ModuleDefinitionFile",
- defsrc->GetFullPath().c_str());
+ cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
+ this->GeneratorTarget->GetModuleDefinitionInfo(config);
+ if (mdi && !mdi->DefFile.empty()) {
+ linkOptions.AddFlag("ModuleDefinitionFile", mdi->DefFile.c_str());
}
linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries",
"%(IgnoreSpecificDefaultLibraries)");
}
- if ((this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->GeneratorTarget->IsExecutableWithExports()) &&
- this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) {
- if (this->GeneratorTarget->GetPropertyAsBool(
- "WINDOWS_EXPORT_ALL_SYMBOLS")) {
- linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)exportall.def");
- }
- }
-
// Hack to fix flag version selection in a common use case.
// FIXME: Select flag table based on toolset instead of VS version.
if (this->LocalGenerator->GetVersion() >=
@@ -3170,18 +3160,15 @@ void cmVisualStudio10TargetGenerator::WriteEvents(
std::string const& configName)
{
bool addedPrelink = false;
- if ((this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
- this->GeneratorTarget->IsExecutableWithExports()) &&
- this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) {
- if (this->GeneratorTarget->GetPropertyAsBool(
- "WINDOWS_EXPORT_ALL_SYMBOLS")) {
- addedPrelink = true;
- std::vector<cmCustomCommand> commands =
- this->GeneratorTarget->GetPreLinkCommands();
- this->GlobalGenerator->AddSymbolExportCommand(this->GeneratorTarget,
- commands, configName);
- this->WriteEvent("PreLinkEvent", commands, configName);
- }
+ cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
+ this->GeneratorTarget->GetModuleDefinitionInfo(configName);
+ if (mdi && mdi->WindowsExportAllSymbols) {
+ addedPrelink = true;
+ std::vector<cmCustomCommand> commands =
+ this->GeneratorTarget->GetPreLinkCommands();
+ this->GlobalGenerator->AddSymbolExportCommand(this->GeneratorTarget,
+ commands, configName);
+ this->WriteEvent("PreLinkEvent", commands, configName);
}
if (!addedPrelink) {
this->WriteEvent("PreLinkEvent",