summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-05-18 15:04:41 +0200
committerGitHub <noreply@github.com>2020-05-18 15:04:41 +0200
commit8ad648f5bfcc929f0f533bd92e0656c3f68b2a0b (patch)
tree1acb34dc0c104ed395cf9cd7ad612dfd53539c5d
parentd0cc9a749fc39c97ebe479c762c94f7232e56dd7 (diff)
parent22c718ab1777485ad5edf5254d45815e7ffa5000 (diff)
Merge pull request #38830 from akien-mga/scons-compilationdb-check
SCons: Improve registration of compilation_db tool, check version
-rw-r--r--SConstruct13
-rw-r--r--misc/scons/compilation_db.py (renamed from misc/scons/site_tools/compilation_db.py)0
2 files changed, 6 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index 86014b8160..f74940b059 100644
--- a/SConstruct
+++ b/SConstruct
@@ -272,14 +272,13 @@ if selected_platform in platform_list:
else:
env = env_base.Clone()
- # Custom tools are loaded automatically by SCons from site_scons/site_tools,
- # but we want to use a different folder, so we register it manually.
- from SCons.Script.Main import _load_site_scons_dir
+ # Compilation DB requires SCons 3.1.1+.
+ from SCons import __version__ as scons_raw_version
- _load_site_scons_dir(".", "misc/scons")
-
- env.Tool("compilation_db")
- env.Alias("compiledb", env.CompilationDatabase("compile_commands.json"))
+ scons_ver = env._get_major_minor_revision(scons_raw_version)
+ if scons_ver >= (3, 1, 1):
+ env.Tool("compilation_db", toolpath=["misc/scons"])
+ env.Alias("compiledb", env.CompilationDatabase("compile_commands.json"))
if env["dev"]:
env["verbose"] = True
diff --git a/misc/scons/site_tools/compilation_db.py b/misc/scons/compilation_db.py
index 87db32adc9..87db32adc9 100644
--- a/misc/scons/site_tools/compilation_db.py
+++ b/misc/scons/compilation_db.py