diff options
author | David Cole <david.cole@kitware.com> | 2012-05-17 18:59:52 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-05-17 18:59:52 (GMT) |
commit | 78733119cbec888f6e6614e9f204194d060be309 (patch) | |
tree | ca09324fe3ce41d209311f54ad7404934029aeee | |
parent | e1c5691a0facad84a54f651b3755322449251a0a (diff) | |
parent | d807aab28fd86586e8ecb5e4f4d35b43bc68d5f8 (diff) | |
download | CMake-78733119cbec888f6e6614e9f204194d060be309.zip CMake-78733119cbec888f6e6614e9f204194d060be309.tar.gz CMake-78733119cbec888f6e6614e9f204194d060be309.tar.bz2 |
Merge topic 'ninja-issue-13069'
d807aab Ninja: apply CMAKE_<LANG>_FLAGS_<TYPE> to executable targets (#13069)
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 11 |
2 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 6362d80..8265d72 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1548,13 +1548,10 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, target.GetName()); return; } - std::string langVar = "CMAKE_"; - langVar += linkLanguage; - std::string flagsVar = langVar + "_FLAGS"; + this->AddLanguageFlags(flags, linkLanguage, buildType.c_str()); std::string sharedFlagsVar = "CMAKE_SHARED_LIBRARY_"; sharedFlagsVar += linkLanguage; sharedFlagsVar += "_FLAGS"; - flags += this->Makefile->GetSafeDefinition(flagsVar.c_str()); flags += " "; flags += this->Makefile->GetSafeDefinition(sharedFlagsVar.c_str()); flags += " "; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 63ba58d..8b86a98 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -193,12 +193,13 @@ cmNinjaNormalTargetGenerator vars.LinkFlags = "$LINK_FLAGS"; std::string langFlags; - this->GetLocalGenerator()->AddLanguageFlags(langFlags, - this->TargetLinkLanguage, - this->GetConfigName()); - if (targetType != cmTarget::EXECUTABLE) + if (targetType != cmTarget::EXECUTABLE) { + this->GetLocalGenerator()->AddLanguageFlags(langFlags, + this->TargetLinkLanguage, + this->GetConfigName()); langFlags += " $ARCH_FLAGS"; - vars.LanguageCompileFlags = langFlags.c_str(); + vars.LanguageCompileFlags = langFlags.c_str(); + } // Rule for linking library. std::vector<std::string> linkCmds = this->ComputeLinkCmd(); |