blob: 6c56237ae6ee7ec84422b30ff3ab83f9cb7e1062 [file]
---
title: 'CcToolchainInfo'
---
Information about the C++ compiler being used.
## Members
* [all_files](#all_files)
* [ar_executable](#ar_executable)
* [built_in_include_directories](#built_in_include_directories)
* [compiler](#compiler)
* [compiler_executable](#compiler_executable)
* [cpu](#cpu)
* [dynamic_runtime_lib](#dynamic_runtime_lib)
* [gcov_executable](#gcov_executable)
* [ld_executable](#ld_executable)
* [libc](#libc)
* [needs_pic_for_dynamic_libraries](#needs_pic_for_dynamic_libraries)
* [nm_executable](#nm_executable)
* [objcopy_executable](#objcopy_executable)
* [objdump_executable](#objdump_executable)
* [preprocessor_executable](#preprocessor_executable)
* [static_runtime_lib](#static_runtime_lib)
* [strip_executable](#strip_executable)
* [sysroot](#sysroot)
* [target_gnu_system_name](#target_gnu_system_name)
## all_files
```
None CcToolchainInfo.all_files
```
Returns all toolchain files (so they can be passed to actions using this toolchain as inputs).
## ar_executable
```
None CcToolchainInfo.ar_executable
```
The path to the ar binary.
## built_in_include_directories
```
None CcToolchainInfo.built_in_include_directories
```
Returns the list of built-in directories of the compiler.
## compiler
```
None CcToolchainInfo.compiler
```
C++ compiler.
## compiler_executable
```
None CcToolchainInfo.compiler_executable
```
The path to the compiler binary.
## cpu
```
None CcToolchainInfo.cpu
```
Target CPU of the C++ toolchain.
## dynamic_runtime_lib
```
None CcToolchainInfo.dynamic_runtime_lib(*, feature_configuration)
```
Returns the files from `dynamic_runtime_lib` attribute (so they can be passed to actions using this toolchain as inputs). The caller can check whether the feature_configuration enables `static_link_cpp_runtimes` feature (if not, neither `static_runtime_lib` nor `dynamic_runtime_lib` have to be used), and use `static_runtime_lib` if static linking mode is active.
### Parameters
| Parameter | Description |
| --- | --- |
| `feature_configuration` | required Feature configuration to be queried. |
## gcov_executable
```
None CcToolchainInfo.gcov_executable
```
The path to the gcov binary.
## ld_executable
```
None CcToolchainInfo.ld_executable
```
The path to the ld binary.
## libc
```
None CcToolchainInfo.libc
```
libc version string.
## needs_pic_for_dynamic_libraries
```
None CcToolchainInfo.needs_pic_for_dynamic_libraries(*, feature_configuration)
```
Returns true if this rule's compilations should apply -fPIC, false otherwise. Determines if we should apply -fPIC for this rule's C++ compilations depending on the C++ toolchain and presence of `--force_pic` Bazel option.
### Parameters
| Parameter | Description |
| --- | --- |
| `feature_configuration` | required Feature configuration to be queried. |
## nm_executable
```
None CcToolchainInfo.nm_executable
```
The path to the nm binary.
## objcopy_executable
```
None CcToolchainInfo.objcopy_executable
```
The path to the objcopy binary.
## objdump_executable
```
None CcToolchainInfo.objdump_executable
```
The path to the objdump binary.
## preprocessor_executable
```
None CcToolchainInfo.preprocessor_executable
```
The path to the preprocessor binary.
## static_runtime_lib
```
None CcToolchainInfo.static_runtime_lib(*, feature_configuration)
```
Returns the files from `static_runtime_lib` attribute (so they can be passed to actions using this toolchain as inputs). The caller should check whether the feature_configuration enables `static_link_cpp_runtimes` feature (if not, neither `static_runtime_lib` nor `dynamic_runtime_lib` should be used), and use `dynamic_runtime_lib` if dynamic linking mode is active.
### Parameters
| Parameter | Description |
| --- | --- |
| `feature_configuration` | required Feature configuration to be queried. |
## strip_executable
```
None CcToolchainInfo.strip_executable
```
The path to the strip binary.
## sysroot
```
None CcToolchainInfo.sysroot
```
Returns the sysroot to be used. If the toolchain compiler does not support different sysroots, or the sysroot is the same as the default sysroot, then this method returns `None`.
## target_gnu_system_name
```
None CcToolchainInfo.target_gnu_system_name
```
The GNU System Name.