Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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``.