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

Add C++ library compilation support. #31

Merged
merged 3 commits into from Mar 30, 2015
Merged

Conversation

KokaKiwi
Copy link
Contributor

No description provided.


// Add specific C++ libraries, if enabled.
if self.cpp {
println!("cargo:rustc-link-lib=static=stdc++");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little surprising to me, I would expect this to be dynamically linked by default. Perhaps this could be its own configuration option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it doesn't compile if I omit this line, so I suppose rustc doesn't link the C++ standard library by default. :p

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'd definitely believe that, but I think it may be best done as a dynamic dependency (e.g. removing static=) instead of a static one. Statically linking libstdc++ is pretty rare I believe.

alexcrichton added a commit that referenced this pull request Mar 30, 2015
Add C++ library compilation support.
@alexcrichton alexcrichton merged commit 2ef6d2d into rust-lang:master Mar 30, 2015
@alexcrichton
Copy link
Member

Thanks!

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.

None yet

2 participants