aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-03-03 10:44:58 +0000
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-03-07 16:25:33 +0000
commit36dc77dc433d3c2c341f56f212ceb1d0047e9969 (patch)
treeb4615dc757591b7a0279d55878f4ea5732a4dc17 /SConstruct
parentf9225b4a8e3fd96edd07765420d37e0efac1c27f (diff)
downloadComputeLibrary-36dc77dc433d3c2c341f56f212ceb1d0047e9969.tar.gz
Add exporting compile_commands.json file
* Add an option in scons script to export compile_commands.json file to support development using language server. * Add .cache directory to the git ignore list. It is normally used by clangd as the local cache. Resolves: COMPMID-5940 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I8c2a1ac85942d34ada22adea3e7de2baf2189eb2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9258 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct8
1 files changed, 8 insertions, 0 deletions
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")