Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't exclude headers - probably user error #224

Open
PSmithsonp4 opened this issue Oct 3, 2024 · 0 comments
Open

Can't exclude headers - probably user error #224

PSmithsonp4 opened this issue Oct 3, 2024 · 0 comments

Comments

@PSmithsonp4
Copy link

Hi,

I doubt this is a bug. I'm very new to Bazel and have probably done something wrong.

I've got a "hello world" project with just one source file - main.cc. I edited MODULE.bazel as per the instructions and now I get a compile_commands.json when I do bazel run @hedron_compile_commands//:refresh_all. I'd like that file to only contain "main.cc" but there's 178 header files. I'm trying to use exclude_headers but I must have done something wrong. This is my BUILD file -

load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")

refresh_compile_commands(
    name = "refresh_compile_commands",
    exclude_headers = "all",
)

cc_binary(
	name = "main",
	srcs = ["main.cc"],
)

I do bazel run @hedron_compile_commands//:refresh_all again. I still have 179 files in the compile_commands.json so I've obviously done something wrong. The instructions recommend adding //BUILD but I don't know what that means exactly or if I needed to do it.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant