瀏覽代碼

cmLocalGenerator: Simplify logic for language standard or extension flag

Brad King 8 年之前
父節點
當前提交
0fc2d78ee9
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Source/cmLocalGenerator.cxx

+ 2 - 2
Source/cmLocalGenerator.cxx

@@ -1494,15 +1494,15 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
     return;
   }
   std::string extProp = lang + "_EXTENSIONS";
-  std::string type = "EXTENSION";
   bool ext = true;
   if (const char* extPropValue = target->GetProperty(extProp)) {
     if (cmSystemTools::IsOff(extPropValue)) {
       ext = false;
-      type = "STANDARD";
     }
   }
 
+  std::string const type = ext ? "EXTENSION" : "STANDARD";
+
   if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) {
     std::string option_flag =
       "CMAKE_" + lang + standardProp + "_" + type + "_COMPILE_OPTION";