This module provides the definitions for registering a GCC toolchain for C and C++.
gcc_toolchain(name, binary_prefix, extra_cflags, extra_cxxflags, extra_fflags, extra_ldflags, gcc_toolchain_workspace_name, includes, repo_mapping, sysroot, target_arch, target_compatible_with, target_settings, toolchain_files_repository_name)
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this repository. | Name | required | |
binary_prefix | An explicit prefix used by each binary in bin/. | String | required | |
extra_cflags | Extra flags for compiling C. | List of strings | optional | [] |
extra_cxxflags | Extra flags for compiling C++. | List of strings | optional | [] |
extra_fflags | Extra flags for compiling Fortran. | List of strings | optional | [] |
extra_ldflags | Extra flags for linking. %sysroot% is rendered to the sysroot path. %workspace% is rendered to the toolchain root path. See https://github.com/bazelbuild/bazel/blob/a48e246e/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java#L234-L254. | List of strings | optional | [] |
gcc_toolchain_workspace_name | The name given to the gcc-toolchain repository, if the default was not used. | String | optional | "gcc_toolchain" |
includes | Extra includes for compiling C and C++. %sysroot% is rendered to the sysroot path. %workspace% is rendered to the toolchain root path. See https://github.com/bazelbuild/bazel/blob/a48e246e/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java#L234-L254. | List of strings | optional | [] |
repo_mapping | A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target , it should actually resolve that dependency within globally-declared @bar (@bar//some:target ). |
Dictionary: String -> String | required | |
sysroot | A sysroot to be used as the logical build root. | String | required | |
target_arch | The target architecture this toolchain produces. E.g. x86_64. | String | required | |
target_compatible_with | contraint_values passed to target_compatible_with of the toolchain. {target_arch} is rendered to the target_arch attribute value. | List of strings | optional | ["@platforms//os:linux", "@platforms//cpu:{target_arch}"] |
target_settings | config_settings passed to target_compatible_with of the toolchain. {target_arch} is rendered to the target_arch attribute value. | List of strings | optional | [] |
toolchain_files_repository_name | The name of the repository containing the toolchain files. | String | required |
gcc_register_toolchain(name, target_arch, gcc_version, kwargs)
Declares a gcc_toolchain
and calls register_toolchain
for it.
PARAMETERS