mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Merge pull request #38830 from akien-mga/scons-compilationdb-check
SCons: Improve registration of compilation_db tool, check version
This commit is contained in:
commit
8ad648f5bf
13
SConstruct
13
SConstruct
@ -272,14 +272,13 @@ if selected_platform in platform_list:
|
|||||||
else:
|
else:
|
||||||
env = env_base.Clone()
|
env = env_base.Clone()
|
||||||
|
|
||||||
# Custom tools are loaded automatically by SCons from site_scons/site_tools,
|
# Compilation DB requires SCons 3.1.1+.
|
||||||
# but we want to use a different folder, so we register it manually.
|
from SCons import __version__ as scons_raw_version
|
||||||
from SCons.Script.Main import _load_site_scons_dir
|
|
||||||
|
|
||||||
_load_site_scons_dir(".", "misc/scons")
|
scons_ver = env._get_major_minor_revision(scons_raw_version)
|
||||||
|
if scons_ver >= (3, 1, 1):
|
||||||
env.Tool("compilation_db")
|
env.Tool("compilation_db", toolpath=["misc/scons"])
|
||||||
env.Alias("compiledb", env.CompilationDatabase("compile_commands.json"))
|
env.Alias("compiledb", env.CompilationDatabase("compile_commands.json"))
|
||||||
|
|
||||||
if env["dev"]:
|
if env["dev"]:
|
||||||
env["verbose"] = True
|
env["verbose"] = True
|
||||||
|
Loading…
Reference in New Issue
Block a user