Переглянути джерело

Merge topic 'better_error_message_on_unsupported_language_level'

ec1e40af1a cmStandardLevelResolver: Better error message on unsupported language level

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !6854
Brad King 3 роки тому
батько
коміт
0c038689be

+ 6 - 2
Source/cmStandardLevelResolver.cxx

@@ -152,8 +152,12 @@ struct StandardLevelComputer
              "dialect \""
           << this->Language << *standardProp << "\" "
           << (ext ? "(with compiler extensions)" : "")
-          << ", but CMake "
-             "does not know the compile flags to use to enable it.";
+          << ". But the current compiler \""
+          << makefile->GetSafeDefinition("CMAKE_" + this->Language +
+                                         "_COMPILER_ID")
+          << "\" does not support this, or "
+             "CMake does not know the flags to enable it.";
+
         makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
       }
       return option_flag;

+ 1 - 2
Tests/RunCMake/CompileFeatures/RequireCXX11-stderr.txt

@@ -1,3 +1,2 @@
 CMake Error in CMakeLists.txt:
-  Target "foo" requires the language dialect "CXX11" , but CMake does not
-  know the compile flags to use to enable it.
+  Target "foo" requires the language dialect "CXX11".*

+ 1 - 1
Tests/RunCMake/CompileFeatures/RequireCXX11Ext-stderr.txt

@@ -1,3 +1,3 @@
 CMake Error in CMakeLists.txt:
   Target "foo" requires the language dialect "CXX11" \(with compiler
-  extensions\), but CMake does not know the compile flags to use to enable it.
+  extensions\).*

+ 1 - 1
Tests/RunCMake/CompileFeatures/RequireCXX11ExtVariable-stderr.txt

@@ -1,3 +1,3 @@
 CMake Error in CMakeLists.txt:
   Target "foo" requires the language dialect "CXX11" \(with compiler
-  extensions\), but CMake does not know the compile flags to use to enable it.
+  extensions\).*

+ 1 - 2
Tests/RunCMake/CompileFeatures/RequireCXX11Variable-stderr.txt

@@ -1,3 +1,2 @@
 CMake Error in CMakeLists.txt:
-  Target "foo" requires the language dialect "CXX11" , but CMake does not
-  know the compile flags to use to enable it.
+  Target "foo" requires the language dialect "CXX11".*

+ 1 - 2
Tests/RunCMake/CompileFeatures/RequireCXX98-stderr.txt

@@ -1,3 +1,2 @@
 CMake Error in CMakeLists.txt:
-  Target "foo" requires the language dialect "CXX98" , but CMake does not
-  know the compile flags to use to enable it.
+  Target "foo" requires the language dialect "CXX98".*

+ 1 - 1
Tests/RunCMake/CompileFeatures/RequireCXX98Ext-stderr.txt

@@ -1,3 +1,3 @@
 CMake Error in CMakeLists.txt:
   Target "foo" requires the language dialect "CXX98" \(with compiler
-  extensions\), but CMake does not know the compile flags to use to enable it.
+  extensions\).*

+ 1 - 1
Tests/RunCMake/CompileFeatures/RequireCXX98ExtVariable-stderr.txt

@@ -1,3 +1,3 @@
 CMake Error in CMakeLists.txt:
   Target "foo" requires the language dialect "CXX98" \(with compiler
-  extensions\), but CMake does not know the compile flags to use to enable it.
+  extensions\).*

+ 1 - 2
Tests/RunCMake/CompileFeatures/RequireCXX98Variable-stderr.txt

@@ -1,3 +1,2 @@
 CMake Error in CMakeLists.txt:
-  Target "foo" requires the language dialect "CXX98" , but CMake does not
-  know the compile flags to use to enable it.
+  Target "foo" requires the language dialect "CXX98".*