diff options
author | Raul Tambre <raul@tambre.ee> | 2021-03-13 13:37:19 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-03-17 15:51:56 (GMT) |
commit | 56c759b000ab5041aff9a92d51a6cc471e7d34a4 (patch) | |
tree | c8b181920834eaa63970012a4f0bd848d11078ff /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 982f7bb5063453d3c0be102c917bb660ec21978b (diff) | |
download | CMake-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.cxx | 7 |
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. |