diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-08-19 20:41:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-21 13:17:27 (GMT) |
commit | 3ef0c40962312a97d5a083c79ec563045fe28de3 (patch) | |
tree | 1b6231bd299e24a59ab83e8af875d77a1e287ba3 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 8de3a25ec34c4b2d3cd7e519d3c3607e81de34c4 (diff) | |
download | CMake-3ef0c40962312a97d5a083c79ec563045fe28de3.zip CMake-3ef0c40962312a97d5a083c79ec563045fe28de3.tar.gz CMake-3ef0c40962312a97d5a083c79ec563045fe28de3.tar.bz2 |
WIN32_EXECUTABLE: Add support for generator expressions
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index db9dc53..fa6ad47 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -595,14 +595,24 @@ void cmVisualStudio10TargetGenerator::Generate() case cmStateEnums::MODULE_LIBRARY: outputType = "Module"; break; - case cmStateEnums::EXECUTABLE: - if (this->GeneratorTarget->Target->GetPropertyAsBool( - "WIN32_EXECUTABLE")) { + case cmStateEnums::EXECUTABLE: { + auto const win32 = + this->GeneratorTarget->GetSafeProperty("WIN32_EXECUTABLE"); + if (win32.find("$<") != std::string::npos) { + this->Makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat( + "Target \"", this->GeneratorTarget->GetName(), + "\" has a generator expression in its WIN32_EXECUTABLE " + "property. This is not supported on managed executables.")); + return; + } + if (cmIsOn(win32)) { outputType = "WinExe"; } else { outputType = "Exe"; } - break; + } break; case cmStateEnums::UTILITY: case cmStateEnums::INTERFACE_LIBRARY: case cmStateEnums::GLOBAL_TARGET: @@ -3731,7 +3741,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( } if (this->MSTools) { - if (this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE")) { + if (this->GeneratorTarget->IsWin32Executable(config)) { if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { |