소스 검색

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