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

Fix test target on macOS with Bazel@HEAD #475

Merged
merged 2 commits into from
Jan 26, 2021

Conversation

meteorcloudy
Copy link
Contributor

supports_dynamic_linker feature was removed from cc toolchain for macOS,
cc_binary should be used to build shared library.

Context: bazelbuild/bazel#4341 (comment)

supports_dynamic_linker feature was removed from cc toolchain for macOS,
cc_binary should be used to build shared library.

Context: bazelbuild/bazel#4341 (comment)
@jsharpe
Copy link
Member

jsharpe commented Jan 26, 2021

Thanks @meteorcloudy. This patch doesn't seem to work on windows though, could you take another look?

@meteorcloudy
Copy link
Contributor Author

@jsharpe Fixed now! The shared library on Windows should end with ".dll" ;)

@jsharpe jsharpe merged commit 8ae4651 into bazel-contrib:master Jan 26, 2021
@jsharpe
Copy link
Member

jsharpe commented Jan 26, 2021

Thanks @meteorcloudy - yes strange that it was working with loading the interface lib instead of dll!

@UebelAndre
Copy link
Collaborator

My bad 😅

Do you know why a cc_binary produces that?

@meteorcloudy
Copy link
Contributor Author

@UebelAndre Do you mean why does a cc_binary output a dll?

@UebelAndre
Copy link
Collaborator

@UebelAndre Do you mean why does a cc_binary output a dll?

Yeah

@meteorcloudy
Copy link
Contributor Author

Oh, it's just the way to build a shared binary with Bazel, you can use a cc_binary rule with linkshared = True, then instead of building an executable binary, it builds a shared library (.so for Linux, .dll for Windows)
Check the linkshared attribute here: https://docs.bazel.build/versions/master/be/c-cpp.html#cc_binary

@UebelAndre
Copy link
Collaborator

Thanks! Good to know 😄

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.

3 participants