瀏覽代碼

project: Fix handling of COMPAT_VERSION

In cmProjectCommand, after validating the VERSION, we move it into a
local variable. Later, however, we were comparing COMPAT_VERSION against
the VERSION stored in the arguments. Compare to the local variable
instead.
Matthew Woehlke 6 月之前
父節點
當前提交
09701440d9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/cmProjectCommand.cxx

+ 1 - 1
Source/cmProjectCommand.cxx

@@ -243,7 +243,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
     }
 
     if (cmSystemTools::VersionCompareGreater(*prArgs.CompatVersion,
-                                             *prArgs.Version)) {
+                                             version_string)) {
       mf.IssueMessage(MessageType::FATAL_ERROR,
                       "COMPAT_VERSION must be less than or equal to VERSION");
       cmSystemTools::SetFatalErrorOccurred();