From 5a6f275b7498e85dc74ecbc14cf264260a2218fa Mon Sep 17 00:00:00 2001 From: RevoluPowered Date: Sat, 2 Nov 2019 14:21:21 +0000 Subject: 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. --- SConstruct | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 0c91399a12..86014b8160 100644 --- a/SConstruct +++ b/SConstruct @@ -272,6 +272,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" -- cgit v1.2.3