cmStandardLevelResolver: Better error message on unsupported language level

Fixes #23079
This commit is contained in:
Robert Maynard
2022-01-11 13:12:45 -05:00
parent 1e839298b0
commit ec1e40af1a
9 changed files with 14 additions and 14 deletions
+6 -2
View File
@@ -152,8 +152,12 @@ struct StandardLevelComputer
"dialect \"" "dialect \""
<< this->Language << *standardProp << "\" " << this->Language << *standardProp << "\" "
<< (ext ? "(with compiler extensions)" : "") << (ext ? "(with compiler extensions)" : "")
<< ", but CMake " << ". But the current compiler \""
"does not know the compile flags to use to enable it."; << 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()); makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
} }
return option_flag; return option_flag;
@@ -1,3 +1,2 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX11" , but CMake does not Target "foo" requires the language dialect "CXX11".*
know the compile flags to use to enable it.
@@ -1,3 +1,3 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX11" \(with compiler 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,3 +1,3 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX11" \(with compiler 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,3 +1,2 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX11" , but CMake does not Target "foo" requires the language dialect "CXX11".*
know the compile flags to use to enable it.
@@ -1,3 +1,2 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX98" , but CMake does not Target "foo" requires the language dialect "CXX98".*
know the compile flags to use to enable it.
@@ -1,3 +1,3 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX98" \(with compiler 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,3 +1,3 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX98" \(with compiler 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,3 +1,2 @@
CMake Error in CMakeLists.txt: CMake Error in CMakeLists.txt:
Target "foo" requires the language dialect "CXX98" , but CMake does not Target "foo" requires the language dialect "CXX98".*
know the compile flags to use to enable it.