Просмотр исходного кода

The error message for VISIBILITY_PRESET now documents valid options.

Rather than just state the value for VISIBILITY_PRESET was invalid,
we additionally list the accepted values.
Robert Maynard 6 лет назад
Родитель
Сommit
619416f8a3

+ 3 - 1
Source/cmLocalGenerator.cxx

@@ -1914,7 +1914,9 @@ static void AddVisibilityCompileOption(std::string& flags,
       strcmp(prop, "protected") != 0 && strcmp(prop, "internal") != 0) {
     std::ostringstream e;
     e << "Target " << target->GetName() << " uses unsupported value \"" << prop
-      << "\" for " << flagDefine << ".";
+      << "\" for " << flagDefine << "."
+      << " The supported values are: default, hidden, protected, and "
+         "internal.";
     cmSystemTools::Error(e.str());
     return;
   }

+ 1 - 1
Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt

@@ -1 +1 @@
-CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET
+CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET. The supported values are: default, hidden, protected, and internal.