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

Update detect_default_compiler and detect_libcxx docs #3509

Merged
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
7 changes: 4 additions & 3 deletions reference/config_files/profiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -650,22 +650,23 @@ the associated runtime, you can use:

.. code-block:: jinja

{% set compiler, version = detect_api.detect_compiler() %}
{% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %}
{% set runtime, _ = detect_api.default_msvc_runtime(compiler) %}
[settings]
compiler={{compiler}}
compiler.version={{detect_api.default_compiler_version(compiler, version)}}
compiler.runtime={{runtime}}
compiler.cppstd={{detect_api.default_cppstd(compiler, version)}}
compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}}

**detect_api reference**:

- **`detect_os()`**: returns operating system as a string (e.g., "Windows", "Macos").
- **`detect_arch()`**: returns system architecture as a string (e.g., "x86_64", "armv8").
- **`detect_libcxx(compiler, version)`**: returns C++ standard library as a string (e.g., "libstdc++", "libc++").
- **`detect_libcxx(compiler, version, compiler_exe=None)`**: returns C++ standard library as a string (e.g., "libstdc++", "libc++").
- **`default_msvc_runtime(compiler)`**: returns tuple with runtime (e.g., "dynamic") and its version (e.g., "v143").
- **`default_cppstd(compiler, compiler_version)`**: returns default C++ standard as a string (e.g., "gnu14").
- **`detect_compiler()`**: returns tuple with compiler name (e.g., "gcc") and its version.
- **`detect_default_compiler()`**: returns tuple with compiler name (e.g., "gcc"), its version and the executable path.
- **`default_msvc_ide_version(version)`**: returns MSVC IDE version as a string (e.g., "17").
- **`default_compiler_version(compiler, version)`**: returns the default version that
Conan uses in profiles, typically dropping some of the minor or patch digits, that
Expand Down