| --- |
| 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. |