diff options
author | Brad King <brad.king@kitware.com> | 2017-04-28 18:30:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-01 14:33:05 (GMT) |
commit | d037be122e15fb3860869e07a0b6ccd8e7d4d94a (patch) | |
tree | daa5d00184619ee9ae07bc10181323a7e3b113d0 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | b115bc49ff26da9db3e9238a98030fd94847d0d0 (diff) | |
download | CMake-d037be122e15fb3860869e07a0b6ccd8e7d4d94a.zip CMake-d037be122e15fb3860869e07a0b6ccd8e7d4d94a.tar.gz CMake-d037be122e15fb3860869e07a0b6ccd8e7d4d94a.tar.bz2 |
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/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 54ae196..0331828 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -655,7 +655,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName); vars["ARCH_FLAGS"] = t; t = ""; - localGen.AddLanguageFlags(t, &genTarget, cudaLinkLanguage, cfgName); + localGen.AddLanguageFlagsForLinking(t, &genTarget, cudaLinkLanguage, + cfgName); vars["LANGUAGE_COMPILE_FLAGS"] = t; } if (this->GetGeneratorTarget()->HasSOName(cfgName)) { @@ -874,7 +875,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["ARCH_FLAGS"] = t; t = ""; t += lwyuFlags; - localGen.AddLanguageFlags(t, &genTarget, TargetLinkLanguage, cfgName); + localGen.AddLanguageFlagsForLinking(t, &genTarget, TargetLinkLanguage, + cfgName); vars["LANGUAGE_COMPILE_FLAGS"] = t; } if (this->GetGeneratorTarget()->HasSOName(cfgName)) { |