summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-06-01 17:45:13 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-06-09 23:41:20 (GMT)
commit74b1c9fc8e8b33c8faa9aadf6ce09c15d94ea011 (patch)
tree4574908690751173637e9ef498c495f6a1501e63 /Source/cmNinjaTargetGenerator.cxx
parent457170a476ca3ff3b5db80360a7fd8202ac31e91 (diff)
downloadCMake-74b1c9fc8e8b33c8faa9aadf6ce09c15d94ea011.zip
CMake-74b1c9fc8e8b33c8faa9aadf6ce09c15d94ea011.tar.gz
CMake-74b1c9fc8e8b33c8faa9aadf6ce09c15d94ea011.tar.bz2
Explicitly specify language flag when source LANGUAGE property is set
Fixes: #14516, #20716
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d406c99..0c7591a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -188,7 +188,16 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
}
}
- std::string flags = this->GetFlags(language, config, filterArch);
+ std::string flags;
+ // explicitly add the explicit language flag before any other flag
+ // this way backwards compatibility with user flags is maintained
+ if (source->GetProperty("LANGUAGE")) {
+ this->LocalGenerator->AppendFeatureOptions(flags, language,
+ "EXPLICIT_LANGUAGE");
+ flags += " ";
+ }
+
+ flags += this->GetFlags(language, config, filterArch);
// Add Fortran format flags.
if (language == "Fortran") {