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

cpp_link_stdlib/cpp_set_stdlib examples #207

Merged

Conversation

Projects
None yet
3 participants
@opilar
Copy link
Contributor

opilar commented Jul 15, 2017

Resolves #179

src/lib.rs Outdated
/// .file("src/foo.c")
/// .shared_flag(true)
/// .cpp_set_stdlib(Some("stdc++"))
/// .compile("libfoo.so");

This comment has been minimized.

@alexcrichton

alexcrichton Jul 16, 2017

Owner

Hm I'm realizing now these have shared_flag, but how come? I think this as-is will fail at runtime because this doesn't support creating libfoo.so afaik.

This comment has been minimized.

@opilar

opilar Jul 19, 2017

Author Contributor

Why? Static library doesn't link. Or you talk about different header files?

This comment has been minimized.

@alexcrichton

alexcrichton Jul 20, 2017

Owner

Oh well so this option is intended for the C++ standard a piece of code is compiled with, but cpp_set_stdlib and such aren't really relevant for linkage other than telling rustc it may want a different C++ standard library.

Perhaps the shared_flag could be removed and libfoo.so could be changed to libfoo.a?

This comment has been minimized.

@opilar

opilar Jul 21, 2017

Author Contributor

Oh year. You're right! It's not only about linking.

@dtolnay
Copy link

dtolnay left a comment

Perhaps the shared_flag could be removed and libfoo.so could be changed to libfoo.a?

@opilar are you still working on changing this?

src/lib.rs Outdated
/// gcc::Config::new()
/// .file("src/foo.c")
/// .shared_flag(true)
/// .cpp_set_stdlib(Some("stdc++"))

This comment has been minimized.

@dtolnay

dtolnay Jul 31, 2017

I would expect the example for cpp_link_stdlib to call cpp_link_stdlib, not cpp_set_stdlib.

This comment has been minimized.

@opilar

opilar Aug 8, 2017

Author Contributor

Thank you! My bad.

@opilar

This comment has been minimized.

Copy link
Contributor Author

opilar commented Aug 8, 2017

@alexcrichton @dtolnay thank you for your help.

@alexcrichton alexcrichton merged commit 6021105 into alexcrichton:master Aug 9, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@alexcrichton

This comment has been minimized.

Copy link
Owner

alexcrichton commented Aug 9, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.