-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Refactor building DLL example on Windows with windows_dll_library #7930
Conversation
@meteorcloudy This is a good solution, but I wanted a mechanism which would work with multiple extensions ( So basically, as a part of plan I switch to one "wrong" (for 2 of 3 cases) extension, like we already have, but in parallel I would like to experiment with BTW, we will keep waiting for C++ Sandwich and Transitive Linking anyway. |
I am not so familiar with the C++ Starlark API, so I'm not sure you can rename the output file name based on target platform. But if bazel/tools/cpp/cc_toolchain_config.bzl.tpl Lines 1092 to 1096 in 6793b93
|
Oh, looks like it is! bazel/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java Lines 720 to 728 in cf8ed73
|
Re Re naming, the api you found is what we use to replace CROSSTOOL, because that is where we specify extension names and prefixes (of output artifacts). With C++ sandwich API (#4570) which is being finished these days (and should be available in 0.26), you'll be able to create artifacts without specifying prefix and extension, and C++ toolchain will set those. |
@hlopko Do you think I can merge this change? |
So why do you want to change this at all? cc_shared_library from examples is just an example, it's not supported, and we don't document or recommend people to use it anywhere. Up until this PR I completely forgot it existed :) |
Just to make the example more simple and clear. |
OK, renamed the macro to |
@hlopko Does this PR look good now? :) |
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.
Great! Thank you! :)
Closes bazelbuild#7930. PiperOrigin-RevId: 243611901
@excitoon Instead of #7629, what do you think of this one?
I would recommend to use
cc_shared_library
to build dll on Windows. Onecc_shared_library
can even depend on another.@hlopko Do you have any plan to implement a
cc_shared_library
in https://github.com/bazelbuild/rules_cc?