summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-29 20:39:07 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-29 20:39:07 (GMT)
commit024d05adada5b9deaac84f0f4df8beed273c972a (patch)
tree7e217bb3e29c8dd9f230dd5dc7f290e9e8b1dec6 /Source/cmMakefileLibraryTargetGenerator.cxx
parentcaee3af3c5625d1a181c90efdff6fb599f21f699 (diff)
downloadCMake-024d05adada5b9deaac84f0f4df8beed273c972a.zip
CMake-024d05adada5b9deaac84f0f4df8beed273c972a.tar.gz
CMake-024d05adada5b9deaac84f0f4df8beed273c972a.tar.bz2
Fix use of module .def files for MS tools
We recognize .def source files and map them to the /DEF:<file> option in the MSVC tools. Previously this worked only for shared libraries. This commit cleans up the implementation and makes it work for executables too. See issue #9613.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx26
1 files changed, 3 insertions, 23 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index bf704d8..9162b4c 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -146,27 +146,8 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
- if(this->Makefile->IsOn("WIN32") && !(this->Makefile->IsOn("CYGWIN")
- || this->Makefile->IsOn("MINGW")))
- {
- const std::vector<cmSourceFile*>& sources =
- this->Target->GetSourceFiles();
- for(std::vector<cmSourceFile*>::const_iterator i = sources.begin();
- i != sources.end(); ++i)
- {
- cmSourceFile* sf = *i;
- if(sf->GetExtension() == "def")
- {
- extraFlags += " ";
- extraFlags +=
- this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
- extraFlags +=
- this->Convert(sf->GetFullPath().c_str(),
- cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::SHELL);
- }
- }
- }
+ this->AddModuleDefinitionFlag(extraFlags);
+
this->WriteLibraryRules(linkRuleVar.c_str(), extraFlags.c_str(), relink);
}
@@ -191,8 +172,8 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
(extraFlags, this->Target->GetProperty(linkFlagsConfig.c_str()));
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MODULE_LINKER_FLAGS", this->ConfigName);
+ this->AddModuleDefinitionFlag(extraFlags);
- // TODO: .def files should be supported here also.
this->WriteLibraryRules(linkRuleVar.c_str(), extraFlags.c_str(), relink);
}
@@ -218,7 +199,6 @@ void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
this->LocalGenerator->AddConfigVariableFlags
(extraFlags, "CMAKE_MACOSX_FRAMEWORK_LINKER_FLAGS", this->ConfigName);
- // TODO: .def files should be supported here also.
this->WriteLibraryRules(linkRuleVar.c_str(), extraFlags.c_str(), relink);
}