浏览代码

SCons: Enforce version 4.0+ when `compiledb=yes` is used

Fixes #65233.
Rémi Verschelde 3 年之前
父节点
当前提交
6c5e085d13
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      SConstruct

+ 6 - 3
SConstruct

@@ -444,9 +444,12 @@ if selected_platform in platform_list:
 
         scons_ver = env._get_major_minor_revision(scons_raw_version)
 
-        if scons_ver >= (4, 0, 0):
-            env.Tool("compilation_db")
-            env.Alias("compiledb", env.CompilationDatabase())
+        if scons_ver < (4, 0, 0):
+            print("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version)
+            Exit(255)
+
+        env.Tool("compilation_db")
+        env.Alias("compiledb", env.CompilationDatabase())
 
     # 'dev' and 'production' are aliases to set default options if they haven't been set
     # manually by the user.