浏览代码

project: Always set COMPAT_VERSION variables

Modify the project command to always set COMPAT_VERSION variables, not
just if experimental CPS export support is enabled. This ensures that
these values are (at least as of the call to the project command) empty
and cannot be "preset" e.g. by command line arguments in the case that
experimental support is enabled after the project command is called.
Matthew Woehlke 6 月之前
父节点
当前提交
6171e2da90
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      Source/cmProjectCommand.cxx

+ 1 - 4
Source/cmProjectCommand.cxx

@@ -262,13 +262,10 @@ bool cmProjectCommand(std::vector<std::string> const& args,
   createVariables("VERSION_MINOR"_s, version_components[1]);
   createVariables("VERSION_PATCH"_s, version_components[2]);
   createVariables("VERSION_TWEAK"_s, version_components[3]);
+  createVariables("COMPAT_VERSION"_s, prArgs.CompatVersion.value_or(""));
   createVariables("DESCRIPTION"_s, prArgs.Description.value_or(""));
   createVariables("HOMEPAGE_URL"_s, prArgs.HomepageURL.value_or(""));
 
-  if (enableCompatVersion) {
-    createVariables("COMPAT_VERSION"_s, prArgs.CompatVersion.value_or(""));
-  }
-
   if (unparsedArgs.empty() && !prArgs.Languages) {
     // if no language is specified do c and c++
     mf.EnableLanguage({ "C", "CXX" }, false);