From c6a5f6ae867c95b56725749474140ffcac51bdac Mon Sep 17 00:00:00 2001 From: Hakim Date: Fri, 9 Aug 2024 19:32:26 +0200 Subject: [PATCH] Make sure not to generate the compile_commands.json when not asked --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index a1f28b1fc607..75e7494d1ab0 100644 --- a/SConstruct +++ b/SConstruct @@ -1015,7 +1015,7 @@ if env["compiledb"] and env.scons_version < (4, 0, 0): # Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later. print_error("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version) Exit(255) -if env.scons_version >= (4, 0, 0): +if env["compiledb"] and env.scons_version >= (4, 0, 0): env.Tool("compilation_db") env.Alias("compiledb", env.CompilationDatabase())