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

zig_binary|library|test should support a Zig binary with library dependencies (.a, .so) #15

Open
2 of 7 tasks
Tracked by #1
aherrmann opened this issue Feb 3, 2023 · 2 comments
Open
2 of 7 tasks
Tracked by #1

Comments

@aherrmann
Copy link
Owner

aherrmann commented Feb 3, 2023

Zig has two different ways to link against pre-built objects or libraries. Either, by passing the corresponding files on the command-line, in which case they are passed as file paths to the underlying linker, or by passing -l type flags, in which case they are looked up in the library search paths and either resolved to files or forwarded as -l type flags to the underlying linker.

@aherrmann aherrmann mentioned this issue Feb 3, 2023
63 tasks
@aherrmann aherrmann added this to the version 0.1 milestone Feb 3, 2023
@aherrmann aherrmann removed this from the version 0.1 milestone Dec 1, 2023
@aherrmann aherrmann changed the title zig_binary should support a Zig binary with library dependencies (.a, .so) zig_binary|library|test should support a Zig binary with library dependencies (.a, .so) Dec 6, 2023
@iphydf
Copy link

iphydf commented Dec 23, 2023

I'm also looking to do what #146 wants. I want to link a cc_library to a zig_binary (or library or test). Also, ideally I would be able to include headers from those cdeps. I'm trying to make https://github.com/nodecum/c-toxcore-zig which depends on https://github.com/TokTok/c-toxcore work in bazel.

iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
iphydf added a commit to iphydf/toktok-stack that referenced this issue Dec 24, 2023
Zig doesn't work very well, yet. You can't depend on C code and can't
include C stdlib headers.

aherrmann/rules_zig#15
aherrmann/rules_zig#161
@aherrmann
Copy link
Owner Author

Linking against static libraries is now supported with #162. Shared library dependencies are a bit more complicated, see #165.

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

No branches or pull requests

2 participants