diff options
author | Brad King <brad.king@kitware.com> | 2022-05-31 19:14:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-05-31 19:40:35 (GMT) |
commit | 39dba8a2449e3f866088b13faf3d6cbf60852751 (patch) | |
tree | 08939d4a398493abbaa9f4ed5191c7004aab2883 /Source/cmLocalGenerator.cxx | |
parent | 0b3056821929646a0b9394c95dbdcc1482a18e89 (diff) | |
download | CMake-39dba8a2449e3f866088b13faf3d6cbf60852751.zip CMake-39dba8a2449e3f866088b13faf3d6cbf60852751.tar.gz CMake-39dba8a2449e3f866088b13faf3d6cbf60852751.tar.bz2 |
cmLocalGenerator: Adopt AppendModuleDefinitionFlag method
Migrate from `cmCommonTargetGenerator::AddModuleDefinitionFlag`.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d2c81ae..15563fe 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3137,6 +3137,32 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags( } } +void cmLocalGenerator::AppendModuleDefinitionFlag( + std::string& flags, cmGeneratorTarget const* target, + cmLinkLineComputer* linkLineComputer, std::string const& config) +{ + cmGeneratorTarget::ModuleDefinitionInfo const* mdi = + target->GetModuleDefinitionInfo(config); + if (!mdi || mdi->DefFile.empty()) { + return; + } + + cmValue defFileFlag = + this->Makefile->GetDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + if (!defFileFlag) { + return; + } + + // Append the flag and value. Use ConvertToLinkReference to help + // vs6's "cl -link" pass it to the linker. + std::string flag = + cmStrCat(*defFileFlag, + this->ConvertToOutputFormat( + linkLineComputer->ConvertToLinkReference(mdi->DefFile), + cmOutputConverter::SHELL)); + this->AppendFlags(flags, flag); +} + bool cmLocalGenerator::AppendLWYUFlags(std::string& flags, const cmGeneratorTarget* target, const std::string& lang) |