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

Add flags from copts and linkopts attributes #796

Merged

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Oct 4, 2021

Without this commit, the copts and linkopts attributes on rules such as make and cmake did not actually add any flags to the foreign build system.

This is similar to #777 and another place where, as far as I can tell, user-supplied flags were silently swallowed. copts is being used in https://github.com/bazelbuild/rules_foreign_cc/blob/a7105dafb067c785cc9ade2c70b0d0ce967490fc/foreign_cc/private/cc_toolchain_util.bzl#L224 but that function always returns an empty dictionary for me. @UebelAndre Do you know how this relates to https://github.com/bazelbuild/rules_foreign_cc/blob/a7105dafb067c785cc9ade2c70b0d0ce967490fc/foreign_cc/private/cc_toolchain_util.bzl#L287 which seems much more feature complete?

@fmeum fmeum force-pushed the fix-copts-linkopts branch 3 times, most recently from 8aafae2 to 931905c Compare October 5, 2021 07:30
@fmeum
Copy link
Member Author

fmeum commented Oct 5, 2021

@UebelAndre I added unittest coverage to this PR. Could you review and merge it before #777? That would make it much easier to add a proper integration test for #777.

Without this commit, the copts and linkopts attributes on rules such as
make and cmake did not actually add any flags to the foreign build
system.

The existing standard_cxx_flags_test is expanded to cover this behavior.
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Very nice! Thank you so much!

@UebelAndre UebelAndre merged commit d93bd96 into bazel-contrib:main Oct 5, 2021
@fmeum fmeum deleted the fix-copts-linkopts branch November 20, 2021 08:52
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