summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-03-13 13:37:19 (GMT)
committerRaul Tambre <raul@tambre.ee>2021-03-17 15:51:56 (GMT)
commit56c759b000ab5041aff9a92d51a6cc471e7d34a4 (patch)
treec8b181920834eaa63970012a4f0bd848d11078ff /Source/cmMakefileExecutableTargetGenerator.cxx
parent982f7bb5063453d3c0be102c917bb660ec21978b (diff)
downloadCMake-56c759b000ab5041aff9a92d51a6cc471e7d34a4.zip
CMake-56c759b000ab5041aff9a92d51a6cc471e7d34a4.tar.gz
CMake-56c759b000ab5041aff9a92d51a6cc471e7d34a4.tar.bz2
Per-language Win32/Console flags
Allows using different compilers with different flags for different languages. For example Clang with GNU-like commandline for CXX and MSVC as host compiler for CUDA. Should help with #21914.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 1750e37..6783341 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -384,11 +384,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
if (this->GeneratorTarget->IsWin32Executable(
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"))) {
this->LocalGenerator->AppendFlags(
- linkFlags, this->Makefile->GetSafeDefinition("CMAKE_CREATE_WIN32_EXE"));
+ linkFlags,
+ this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", linkLanguage, "_CREATE_WIN32_EXE")));
} else {
this->LocalGenerator->AppendFlags(
linkFlags,
- this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE"));
+ this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", linkLanguage, "_CREATE_CONSOLE_EXE")));
}
// Add symbol export flags if necessary.