-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] LNK4217 and LNK4286 warnings when linking //:benchmark_main #1372
Comments
Both warnings are essentially saying that |
Oh, and I just noticed this too:
What's up with that? O_o |
I don't know what To summarize, the following rules apply:
There might be an inconsistency in the way Bazel propagates defines. |
Do we need Bazel to create the dynamic library? I'm asking because I'm not aware of any way to make Bazel follow such rules, but we can easily stop Bazel from ever creating the dynamic library by setting |
This is the easy way out. Alternatively, one could build two library variants separately. |
@dominichamon, do you know whether anyone or anything expects Bazel to create the dynamic library? My experience has been entirely with dynamic libraries (e.g. Python extensions) that are opened at runtime (e.g. by Python), not linked by Bazel during dependent build actions. Unless the Bazel build needs to support a use case such as packaging, erring on the side of simplicity seems preferable for now. |
when building benchmark_main, i think either a dynamic or static library would be appropriate. i don't think there's much of an expectation either way more broadly. |
Posted #1373 for review. :) |
If someone or something ever needs the dynamic library as a Bazel build artifact, we can figure that out for them then, but right now, there is no strong reason to be wrangling various `export.h`-controlling macros. Fixes #1372.
After following up with #1374, I reran the CI job for RE2 and it's now showing zero warnings related to the benchmark library across Linux, macOS and Windows. Thanks! |
(The full logs are here.)
The text was updated successfully, but these errors were encountered: