Added compilation database support for clang and gcc

This tool is originally from mongodb.

- Updated CPPSUFFIXES to use scons suffixes
- objective-c files will also be loaded into the compilation database where the compiler / tooling is available to compile the files.

Known limitations:

- This will not work with msvc as your compiler.

(cherry picked from commit 5a6f275b74)
This commit is contained in:
RevoluPowered
2019-11-02 14:21:21 +00:00
committed by Rémi Verschelde
parent 35d95918ae
commit 9aa4648579
3 changed files with 189 additions and 1 deletions

View File

@ -258,6 +258,15 @@ 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
_load_site_scons_dir(".", "misc/scons")
env.Tool("compilation_db")
env.Alias("compiledb", env.CompilationDatabase("compile_commands.json"))
if env['dev']:
env['verbose'] = True
env['warnings'] = "extra"