diff --git a/BUILD.bazel b/BUILD.bazel index f0663865e2e..ac170bc6ca8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -43,6 +43,7 @@ refresh_compile_commands( name = "compiledb", exclude_external_sources = True, exclude_headers = "all", # not using "all" adds headers as sources to compile_commands.json which is never what we want + tags = ["compiledb"], targets = { "//src/...": "", }, diff --git a/site_scons/site_tools/integrate_bazel.py b/site_scons/site_tools/integrate_bazel.py index 00e5db98f39..42e1289cac1 100644 --- a/site_scons/site_tools/integrate_bazel.py +++ b/site_scons/site_tools/integrate_bazel.py @@ -440,9 +440,12 @@ def bazel_build_thread_func(env, log_dir: str, verbose: bool, ninja_generate: bo for file in glob.glob("bazel-out/**/*.gen_source_list", recursive=True): os.remove(file) extra_args += ["--build_tag_filters=scons_link_lists"] + bazel_cmd = Globals.bazel_base_build_command + extra_args + ["//src/..."] + + elif SCons.Script.BUILD_TARGETS == ["compiledb"]: + extra_args += ["--build_tag_filters=scons_link_lists,compiledb,gen_source"] + bazel_cmd = Globals.bazel_base_build_command + extra_args + ["//:compiledb", "//src/..."] - if SCons.Script.BUILD_TARGETS == ["compiledb"]: - bazel_cmd = Globals.bazel_base_build_command + extra_args + ["//:compiledb"] else: bazel_cmd = Globals.bazel_base_build_command + extra_args + ["//src/..."]