summaryrefslogtreecommitdiff
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-31 15:20:52 -0400
committerBrad King <brad.king@kitware.com>2022-05-31 15:40:58 -0400
commit6cc417586ed0e3f86d0cde88bcdcae32cb7a0ea5 (patch)
tree0514c35c967accae92faa9a300d4b69671bb0ab3 /Source/cmLocalGenerator.cxx
parent39dba8a2449e3f866088b13faf3d6cbf60852751 (diff)
downloadcmake-6cc417586ed0e3f86d0cde88bcdcae32cb7a0ea5.tar.gz
Ninja: Avoid duplicating /DEF: linker flag with MSVC tools
In commit 9a0d5a828a (Ninja: add /DEF: flag to linker call, 2012-03-10, v2.8.8~22^2~7) the logic should have been added to `GetTargetFlags` in place of the older logic in that method from commit 7cef36c628 (ENH: add the ability to generate custom commands for a language that is not supported by an IDE, 2004-10-21, v2.4.0~2655). Fixes: #23570
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx18
1 files changed, 2 insertions, 16 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 15563fe5de..7928a46f7d 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1448,22 +1448,6 @@ void cmLocalGenerator::GetTargetFlags(
sharedLibFlags += this->Makefile->GetSafeDefinition(build);
sharedLibFlags += " ";
}
- if (this->Makefile->IsOn("WIN32") &&
- !(this->Makefile->IsOn("CYGWIN") ||
- this->Makefile->IsOn("MINGW"))) {
- std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources, config);
- std::string defFlag =
- this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
- for (cmSourceFile* sf : sources) {
- if (sf->GetExtension() == "def") {
- sharedLibFlags += defFlag;
- sharedLibFlags +=
- this->ConvertToOutputFormat(sf->ResolveFullPath(), SHELL);
- sharedLibFlags += " ";
- }
- }
- }
}
cmValue targetLinkFlags = target->GetProperty("LINK_FLAGS");
@@ -1577,6 +1561,8 @@ void cmLocalGenerator::GetTargetFlags(
this->AppendPositionIndependentLinkerFlags(extraLinkFlags, target, config,
linkLanguage);
this->AppendIPOLinkerFlags(extraLinkFlags, target, config, linkLanguage);
+ this->AppendModuleDefinitionFlag(extraLinkFlags, target, linkLineComputer,
+ config);
if (!extraLinkFlags.empty()) {
linkFlags.emplace_back(std::move(extraLinkFlags));