-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Allow removal of default cc flags #14735
Allow removal of default cc flags #14735
Conversation
55fc190
to
7a979a5
Compare
Previously, it was not possible to remove "/DEFAULTLIB:msvcrt" from the linker command line as native logic would disallow disabling the "dynamic_link_msvcrt" cc "feature". This would cause build failures in certain scenarios, e.g. when building the Qt library using Bazel. By starlarkifying the native logic, users can now remove the "/DEFAULTLIB" linker flag by adding "--features=-dynamic_link_msvcrt[_no_debug]" to the invocation of bazel.
Previously, it was not possible to disable cc "features" such as "default_compile_flags", which would cause builds to fail in certain scenarios, such as building 3rd party projects under Bazel. Now, users can remove default flags (like D_WIN32_WINNT) by adding "--features=-default_compile_flags" to the invocation of Bazel".
7a979a5
to
057059d
Compare
Any chance of a review of this PR? |
Friendly ping |
Erm, sorry for the delay. Routing this to the right person. |
@oquenchil Friendly ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR modifies the cc toolchain logic so that users can remove (most of) the default compile/linker flags if they so wish. This is required when building 3rd party projects, e.g. Qt, using Bazel. Closes bazelbuild#14735. PiperOrigin-RevId: 471502084 Change-Id: Idbc3e6685bc10c6b51fdff7ab7839dc9e00a5209
Hey @jheaff1, thank you for fixing this. Mind providing an example of how one can nowadays disable For the record I tried adding
I'm using Bazel 6.2.1. |
I’m surprised that adding |
This PR modifies the cc toolchain logic so that users can remove (most of) the default compile/linker flags if they so wish. This is required when building 3rd party projects, e.g. Qt, using Bazel.