Add support of "LINKER:" prefix for Windows executable creation

The following variables now support the LINKER: prefix:
* CMAKE_<LANG>_CREATE_WIN32_EXE
* CMAKE_<LANG>_CREATE_CONSOLE_EXE
This commit is contained in:
Marc Chevrier
2024-10-28 18:18:43 +01:00
parent 8bcf9c7a3e
commit 61aee8c7bd
17 changed files with 96 additions and 48 deletions
+10 -10
View File
@@ -375,17 +375,17 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
linkFlags, "CMAKE_EXE_LINKER_FLAGS", this->GeneratorTarget,
cmBuildStep::Link, linkLanguage, this->GetConfigName());
if (this->GeneratorTarget->IsWin32Executable(
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"))) {
{
auto exeType =
cmStrCat("CMAKE_", linkLanguage, "_CREATE_",
(this->GeneratorTarget->IsWin32Executable(
this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
? "WIN32"
: "CONSOLE"),
"_EXE");
this->LocalGenerator->AppendFlags(
linkFlags,
this->Makefile->GetSafeDefinition(
cmStrCat("CMAKE_", linkLanguage, "_CREATE_WIN32_EXE")));
} else {
this->LocalGenerator->AppendFlags(
linkFlags,
this->Makefile->GetSafeDefinition(
cmStrCat("CMAKE_", linkLanguage, "_CREATE_CONSOLE_EXE")));
linkFlags, this->Makefile->GetDefinition(exeType), exeType,
this->GeneratorTarget, cmBuildStep::Link, linkLanguage);
}
// Add symbol export flags if necessary.