summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Davies <matthew.davies@sony.com>2020-03-18 12:38:38 (GMT)
committerMatt Davies <matthew.davies@sony.com>2020-03-20 16:16:58 (GMT)
commitf00e1b816d7220b700f7f8d24347d80b66e30c86 (patch)
tree7bef62d768870bea728b6553bdaa4e9f21371ce2
parent2ce42f281fb5403cad398e886f0138d60f6a1dae (diff)
downloadCMake-f00e1b816d7220b700f7f8d24347d80b66e30c86.zip
CMake-f00e1b816d7220b700f7f8d24347d80b66e30c86.tar.gz
CMake-f00e1b816d7220b700f7f8d24347d80b66e30c86.tar.bz2
VS: Add VS_SOURCE_SETTINGS_<tool> target property
VS_SOURCE_SETTINGS_<tool> is a list of key value pairs that get written as item metadata for any file associated with <tool> for that target. The entire value of VS_SOURCE_SETTINGS_<tool> is evaluated as a generator expression. VS_SETTINGS can override settings specified in this property.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d67fe72..7eaf625 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1967,6 +1967,22 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
}
}
+ if (ParsedToolTargetSettings.find(tool) == ParsedToolTargetSettings.end()) {
+ const char* toolTargetProperty =
+ this->GeneratorTarget->Target->GetProperty("VS_SOURCE_SETTINGS_" +
+ std::string(tool));
+ ConfigToSettings toolTargetSettings;
+ ParseSettingsProperty(toolTargetProperty, toolTargetSettings);
+
+ ParsedToolTargetSettings[tool] = toolTargetSettings;
+ }
+
+ for (const auto& configToSetting : ParsedToolTargetSettings[tool]) {
+ for (const auto& setting : configToSetting.second) {
+ toolSettings[configToSetting.first][setting.first] = setting.second;
+ }
+ }
+
ParseSettingsProperty(sf->GetProperty("VS_SETTINGS"), toolSettings);
if (!toolSettings.empty()) {
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 790811b..f5eb72b 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -241,6 +241,7 @@ private:
using ConfigToSettings =
std::unordered_map<std::string,
std::unordered_map<std::string, std::string>>;
+ std::unordered_map<std::string, ConfigToSettings> ParsedToolTargetSettings;
bool PropertyIsSameInAllConfigs(const ConfigToSettings& toolSettings,
const std::string& propName);
void ParseSettingsProperty(const char* settingsPropertyValue,