|
@@ -2036,6 +2036,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
|
|
}
|
|
}
|
|
|
std::string flags;
|
|
std::string flags;
|
|
|
bool configDependentFlags = false;
|
|
bool configDependentFlags = false;
|
|
|
|
|
+ std::string options;
|
|
|
|
|
+ bool configDependentOptions = false;
|
|
|
std::string defines;
|
|
std::string defines;
|
|
|
bool configDependentDefines = false;
|
|
bool configDependentDefines = false;
|
|
|
if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) {
|
|
if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) {
|
|
@@ -2043,6 +2045,11 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
|
|
cmGeneratorExpression::Find(cflags) != std::string::npos;
|
|
cmGeneratorExpression::Find(cflags) != std::string::npos;
|
|
|
flags += cflags;
|
|
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")) {
|
|
if (const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) {
|
|
|
configDependentDefines =
|
|
configDependentDefines =
|
|
|
cmGeneratorExpression::Find(cdefs) != std::string::npos;
|
|
cmGeneratorExpression::Find(cdefs) != std::string::npos;
|
|
@@ -2099,7 +2106,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
|
|
}
|
|
}
|
|
|
// if we have flags or defines for this config then
|
|
// if we have flags or defines for this config then
|
|
|
// use them
|
|
// use them
|
|
|
- if (!flags.empty() || !configDefines.empty() || compileAs || noWinRT) {
|
|
|
|
|
|
|
+ if (!flags.empty() || !options.empty() || !configDefines.empty() ||
|
|
|
|
|
+ compileAs || noWinRT) {
|
|
|
(*this->BuildFileStream) << firstString;
|
|
(*this->BuildFileStream) << firstString;
|
|
|
firstString = ""; // only do firstString once
|
|
firstString = ""; // only do firstString once
|
|
|
hasFlags = true;
|
|
hasFlags = true;
|
|
@@ -2137,6 +2145,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
|
|
} else {
|
|
} else {
|
|
|
clOptions.Parse(flags.c_str());
|
|
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")) {
|
|
if (clOptions.HasFlag("AdditionalIncludeDirectories")) {
|
|
|
clOptions.AppendFlag("AdditionalIncludeDirectories",
|
|
clOptions.AppendFlag("AdditionalIncludeDirectories",
|
|
|
"%(AdditionalIncludeDirectories)");
|
|
"%(AdditionalIncludeDirectories)");
|