From b64e8f22a4f08972e2d4b2bd5bd338247ec0946c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 Jul 2013 10:14:33 -0400 Subject: [PATCH] VS10: Honor user-specified /SUBSYSTEM: flag (#14326) Use the WIN32_EXECUTABLE target property only to set the SubSystem build attribute default. When user-specified flags are later parsed they may then override it. --- Source/cmVisualStudio10TargetGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index da5696ac2..113070497 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1520,11 +1520,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) } if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") ) { - flags += " /SUBSYSTEM:WINDOWS"; + linkOptions.AddFlag("SubSystem", "Windows"); } else { - flags += " /SUBSYSTEM:CONSOLE"; + linkOptions.AddFlag("SubSystem", "Console"); } std::string standardLibsVar = "CMAKE_"; standardLibsVar += linkLanguage;