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

View File

@@ -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;

View File

@@ -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".*

View File

@@ -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\).*

View File

@@ -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\).*

View File

@@ -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".*

View File

@@ -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".*

View File

@@ -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\).*

View File

@@ -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\).*

View File

@@ -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".*