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

Merge user provided CPPFLAGS with build system CPPFLAGS #1261

Merged
merged 6 commits into from
Aug 14, 2024

Conversation

allsey87
Copy link
Contributor

Another PR regarding flags being set in env. Currently there is no solution to set CPPFLAGS via configure_make. If you set them in the environment, they will be clobbered by the build system flags. If you set them via configure_options or configure_prefix (I saw someone doing that somewhere), then they clobber the build system CPPFLAGS meaning you cannot use dependencies (since this is how header files from dependencies are made during the build).

@@ -82,6 +85,7 @@ _MAKE_FLAGS = {
"AR_FLAGS": "cxx_linker_static",
"ASFLAGS": "assemble",
"CFLAGS": "cc",
"CPPFLAGS": "",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this @jsharpe? It is a bit of a hack that exploits that getattr(flags, _MAKE_FLAGS[flag], []) below will default to an empty list since an attribute cannot have an empty key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed this in 799f91c, I think it is better to be more explicit here.

@jsharpe jsharpe enabled auto-merge (squash) August 14, 2024 16:01
@jsharpe
Copy link
Member

jsharpe commented Aug 14, 2024

@allsey87 if you update this branch then it will auto merge once CI has run - I don't have permissions on your fork to update it myself.

@jsharpe jsharpe merged commit d9367d2 into bazel-contrib:main Aug 14, 2024
2 checks passed
jsharpe pushed a commit to jsharpe/rules_foreign_cc that referenced this pull request Aug 23, 2024
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

Successfully merging this pull request may close these issues.

2 participants