summaryrefslogtreecommitdiff
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-28 14:30:00 -0400
committerBrad King <brad.king@kitware.com>2017-05-01 10:33:05 -0400
commitd037be122e15fb3860869e07a0b6ccd8e7d4d94a (patch)
treedaa5d00184619ee9ae07bc10181323a7e3b113d0 /Source/cmMakefileLibraryTargetGenerator.cxx
parentb115bc49ff26da9db3e9238a98030fd94847d0d0 (diff)
downloadcmake-d037be122e15fb3860869e07a0b6ccd8e7d4d94a.tar.gz
cmLocalGenerator: Add a hook for compiler flags used at link time
When using a compiler to drive linking we add compiler flags from `CMAKE_<LANG>_FLAGS` in case they affect the way the compiler invokes the linker, but we don't add flags from other places that are meant only for compiling sources. Rather than calling the `AddLanguageFlags` method (which is used to add flags for compiling sources) directly, add an intermediate method that is used when adding the flags for linking. This will give us a way to add language-specific compiler flags needed when driving the linker in the same place on the command line as other compiler flags go.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 5ee9f45374..2b37b4dcaa 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -397,8 +397,8 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
// Add language-specific flags.
std::string langFlags;
- this->LocalGenerator->AddLanguageFlags(langFlags, this->GeneratorTarget,
- linkLanguage, this->ConfigName);
+ this->LocalGenerator->AddLanguageFlagsForLinking(
+ langFlags, this->GeneratorTarget, linkLanguage, this->ConfigName);
vars.LanguageCompileFlags = langFlags.c_str();
@@ -858,8 +858,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Add language-specific flags.
std::string langFlags;
- this->LocalGenerator->AddLanguageFlags(langFlags, this->GeneratorTarget,
- linkLanguage, this->ConfigName);
+ this->LocalGenerator->AddLanguageFlagsForLinking(
+ langFlags, this->GeneratorTarget, linkLanguage, this->ConfigName);
this->LocalGenerator->AddArchitectureFlags(
langFlags, this->GeneratorTarget, linkLanguage, this->ConfigName);