diff options
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1b09600..122ba4e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2036,6 +2036,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } std::string flags; bool configDependentFlags = false; + std::string options; + bool configDependentOptions = false; std::string defines; bool configDependentDefines = false; if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) { @@ -2043,6 +2045,11 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( cmGeneratorExpression::Find(cflags) != std::string::npos; flags += cflags; } + if (const char* coptions = sf.GetProperty("COMPILE_OPTIONS")) { + configDependentOptions = + cmGeneratorExpression::Find(coptions) != std::string::npos; + options += coptions; + } if (const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) { configDependentDefines = cmGeneratorExpression::Find(cdefs) != std::string::npos; @@ -2099,7 +2106,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } // if we have flags or defines for this config then // use them - if (!flags.empty() || !configDefines.empty() || compileAs || noWinRT) { + if (!flags.empty() || !options.empty() || !configDefines.empty() || + compileAs || noWinRT) { (*this->BuildFileStream) << firstString; firstString = ""; // only do firstString once hasFlags = true; @@ -2137,6 +2145,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( } else { clOptions.Parse(flags.c_str()); } + if (!options.empty()) { + std::string expandedOptions; + if (configDependentOptions) { + this->LocalGenerator->AppendCompileOptions( + expandedOptions, + genexInterpreter.Evaluate(options, "COMPILE_OPTIONS")); + } else { + this->LocalGenerator->AppendCompileOptions(expandedOptions, options); + } + clOptions.Parse(expandedOptions.c_str()); + } if (clOptions.HasFlag("AdditionalIncludeDirectories")) { clOptions.AppendFlag("AdditionalIncludeDirectories", "%(AdditionalIncludeDirectories)"); |