diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | SConstruct | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 6852bddf42..ac38812141 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ ENV/ # IDE folders .idea/ .vscode/ +.cache/ diff --git a/SConstruct b/SConstruct index ca53246834..2e20931552 100644 --- a/SConstruct +++ b/SConstruct @@ -140,6 +140,9 @@ vars.AddVariables( ("build_config", "Operator/Data-type/Data-layout configuration to use for tailored ComputeLibrary builds. Can be a JSON file or a JSON formatted string", "") ) +if version_at_least(SCons.__version__, "4.0"): + vars.Add(BoolVariable("export_compile_commands", "Export compile_commands.json file.", False)) + env = Environment(variables=vars, ENV = os.environ) @@ -181,6 +184,11 @@ Export('install_bin') Help(vars.GenerateHelpText(env)) +# Export compile_commands.json file +if env.get("export_compile_commands", False): + env.Tool("compilation_db") + env.CompilationDatabase("%s/compile_commands.json" % build_path) + if 'armv7a' in env['arch'] and env['os'] == 'android': print("WARNING: armv7a on Android is no longer maintained") |