summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-12 15:36:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-12 15:36:28 (GMT)
commit498be66fd7211fb782eaac8be7c2b0e50e3ab5da (patch)
tree2bf6aa9f7a8132b8585bcc53394df3802a6f34b4 /Source/cmVisualStudio10TargetGenerator.cxx
parent2cdefcbe62707a82eccbc301fe34f85bb74d932a (diff)
parent312527de473692e17f2b858a87faa157c73e488f (diff)
downloadCMake-498be66fd7211fb782eaac8be7c2b0e50e3ab5da.zip
CMake-498be66fd7211fb782eaac8be7c2b0e50e3ab5da.tar.gz
CMake-498be66fd7211fb782eaac8be7c2b0e50e3ab5da.tar.bz2
Merge topic 'add_support_for_clr_targets'
312527de47 document COMMON_LANGUAGE_RUNTIME target properties 4b7a82b4ed cmVisualStudio10TargetGenerator: set /clr compiler flag from property 20e31fb4c9 cmExportFileGenerator: add target property for managed targets 411a22706a cmGeneratorTarget: add handling of managed assemblies to HasImportLibrary() fb433ff283 cmGeneratorTarget: Make import library checks config-aware 4c1f33961f cmGeneratorTarget: add GetManagedType() and CheckManagedType() methods 6c517a9f8d cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1916
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3289b55..13af167 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2418,6 +2418,22 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("AssemblerListingLocation", asmLocation);
}
}
+
+ // check for managed C++ assembly compiler flag. This overrides any
+ // /clr* compiler flags which may be defined in the flags variable(s).
+ if (this->ProjectType != csproj) {
+ // TODO: add check here, if /clr was defined manually and issue
+ // warning that this is discouraged.
+ if (auto* clr =
+ this->GeneratorTarget->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
+ std::string clrString = clr;
+ if (!clrString.empty()) {
+ clrString = ":" + clrString;
+ }
+ flags += " /clr" + clrString;
+ }
+ }
+
clOptions.Parse(flags.c_str());
clOptions.Parse(defineFlags.c_str());
std::vector<std::string> targetDefines;