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

Improve docs for the C++ usage #600

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

SallySoul
Copy link
Contributor

@SallySoul SallySoul commented May 14, 2021

I was having some issues with the c++ standard library on different platforms (since resolved), but that lead me to notice that there was a broken doc link for get_cpp_link_stdlib, which wasn't public, so its documentation is not in the html docs.

Making get_cpp_link_stdlib public provides a good place for the missing information in the html docs, so if only for that reason I think it should be public. Of course, I understand if y'all disagree.

@alexcrichton
Copy link
Member

Thanks for the PR, but do you have an intended use for making this function public? It sounds like it's just here for documentation? If that's the case could this perhaps be recast differently?

@SallySoul
Copy link
Contributor Author

That's fair, I don't have a use case in mind for exposing that function. However, I found the the doc for get_cpp_link_stdlib useful, and I think it could be a good addition to the public docs. Maybe adding a version of the comment to the Build::cpp function might be useful. Something like

/// Set C++ support.
///
/// The other `cpp_*` options will only become active if this is set to
/// `true`.
///
/// The name of the c++ standard library to link is decided by:
/// 1. If [cpp_link_stdlib](cc::Build::cpp_link_stdlib) is set, use its value.
/// 2. Else if the `CXXSTDLIB` environment variable is set, use its value.
/// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android,
/// `None` for MSVC and `libstdc++` for anything else.

On the other hand, I don't want to waste your time bike shedding this, feel free to close.

@alexcrichton
Copy link
Member

I'm always fine with tweaking docs! I'm hesitant to expose a function just because it's there though, I would prefer to keep things private if possible.

@SallySoul
Copy link
Contributor Author

I appreciate that! I revised the update accordingly.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Approving as this now touches the docs only. Thanks!

@JohnTitor JohnTitor changed the title Make get_cpp_link_stdlib public, and fix doc warnings Improve docs for the C++ usage Apr 24, 2023
@JohnTitor JohnTitor merged commit 2db18d2 into rust-lang:main Apr 24, 2023
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

3 participants