diff options
author | Brad King <brad.king@kitware.com> | 2020-12-04 13:27:36 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-04 13:27:55 (GMT) |
commit | 76685b985d9ec91f7ffa036cc2a43bca6477f6e9 (patch) | |
tree | bb1ee84f0c5c16b3fb1a670fa4800c4afdfc1f0a /Source/cmNinjaTargetGenerator.cxx | |
parent | 16c0057a13282001a5de56a8eb434b299aea3282 (diff) | |
parent | 48aac247e922409b4dfe7189521661df4b0583d1 (diff) | |
download | CMake-76685b985d9ec91f7ffa036cc2a43bca6477f6e9.zip CMake-76685b985d9ec91f7ffa036cc2a43bca6477f6e9.tar.gz CMake-76685b985d9ec91f7ffa036cc2a43bca6477f6e9.tar.bz2 |
Merge topic 'explicit-LANGUAGE-flag'
48aac247e9 Compile with explicit language flag when source LANGUAGE property is set
2e67a75acd Embarcadero: Simplify addition of -P flag for C++
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5522
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 99f1b45..6edbf82 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -185,7 +185,15 @@ 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 + // so user flags can override it. + this->GeneratorTarget->AddExplicitLanguageFlags(flags, *source); + + if (!flags.empty()) { + flags += " "; + } + flags += this->GetFlags(language, config, filterArch); // Add Fortran format flags. if (language == "Fortran") { |