Sfoglia il codice sorgente

VS: Recognize -std: flag in CMAKE_C_FLAGS in target with C++ sources

Extend commit b325484928 (VS: Fix C language standard in target with C++
sources, 2020-09-28, v3.19.0-rc1~74^2) to account for users placing a
`-std:` flag in `CMAKE_C_FLAGS`.
Brad King 3 anni fa
parent
commit
ad16ae5c70
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 2 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -3293,6 +3293,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
     this->GeneratorTarget->GetLanguages(languages, configName);
     if (languages.count("C")) {
       std::string flagsC;
+      this->LocalGenerator->AddLanguageFlags(
+        flagsC, this->GeneratorTarget, cmBuildStep::Compile, "C", configName);
       this->LocalGenerator->AddCompileOptions(flagsC, this->GeneratorTarget,
                                               "C", configName);
       Options optC(this->LocalGenerator, Options::Compiler,