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

build.rs: FreeBSD support #62

Open
valpackett opened this issue Jul 30, 2019 · 3 comments
Open

build.rs: FreeBSD support #62

valpackett opened this issue Jul 30, 2019 · 3 comments

Comments

@valpackett
Copy link

valpackett commented Jul 30, 2019

  • emit_std_cpp_link: ("freebsd", _) is like ("macos", _), we use libc++
  • in the big match (target_os.as_str(), target_env.as_str()), it would make sense to move ("linux", _) code to (_, _) so that it works on any unix-like platform, and use emit_std_cpp_link there instead of hardcoding stdc++
  • a default search dir of "/usr/local/lib" for target_os == "freebsd" would be nice
  • also a way to force using the shared lib when combined exists..
@valpackett
Copy link
Author

Please at least do the libc++ thing, anything depending on unmodified shaderc-rs is literally unusable because the -lstdc++ linker argument makes everything blow up :(

@antiagainst
Copy link
Collaborator

Thanks for the comment. But I'm not familiar with FreeBSD and don't have a FreeBSD environment for developing to make sure everything functions properly. If you can send a pull request that would be awesome!

@valpackett
Copy link
Author

Well, there's the whole CLA thing. I don't remember if the CLA form requires lots of personal information still, but I can't even sign into the google account for my current email address because it insists on a phone number >_<

Anyway my previous comment is a bit wrong, there's actually no -lstdc++, just lack of -lc++.

You can get away with no testing, I have already tested the following very obvious changes: just treat "freebsd" exactly as "macos" in these three places:

if target_os == "macos" {

("macos", _) => {

("macos", _) => println!("cargo:rustc-link-lib=dylib=c++"),

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