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 docs for tools.stdcpp_library #1714

Merged
merged 3 commits into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions reference/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1747,3 +1747,21 @@ for ``compiler.cppstd=17``, and so on.

Parameters:
- **settings** (Required): Conanfile settings. Use ``self.settings``.


.. _tools.stdcpp_library:

tools.stdcpp_library():
-----------------------
Comment on lines +1754 to +1755
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tools.stdcpp_library():
-----------------------
tools.stdcpp_library()
----------------------


.. code-block:: python

def stdcpp_library(conanfile)

Returns the corresponding C++ standard library to link with based on the settings of the given conanfile. For instance, it may return ``c++`` for ``compiler.libcxx=libc++``,
and it may return ``stdc++`` for ``compiler.libcxx=libstdc++`` or ``compiler.libcxx=libstdc++11``. Returns ``None`` if there is no C++ standard library
need to be linked. Usually, this is required to populate ``self.cpp_info.system_libs`` for C++ libraries with plain C API, therefore such libraries might be
safely used in pure C projects (or in general, non-C++ projects capable of using C API, such as written in Objective-C, Fortran, etc.).

Parameters:
- **conanfile** (Required): ConanFile instance. Usually ``self``.