Skip to main content

cxx_toolchain

cxx_toolchain

def cxx_toolchain(
*,
name: str,
default_target_platform: None | str = None,
target_compatible_with: list[str] = [],
compatible_with: list[str] = [],
exec_compatible_with: list[str] = [],
visibility: list[str] = [],
within_view: list[str] = ["PUBLIC"],
metadata: OpaqueMetadata = {},
tests: list[str] = [],
modifiers: OpaqueMetadata = [],
_apple_platforms: dict[str, str] = {},
_dumpbin_toolchain_path: None | str = None,
_msvc_hermetic_exec: str = "prelude//windows/tools:msvc_hermetic_exec",
archive_contents: str = "normal",
archive_symbol_table: bool = True,
archiver: str,
archiver_flags: list[str] = [],
archiver_reads_inputs: bool = True,
archiver_supports_argfiles: bool = False,
archiver_type: str,
asm_compiler: None | str = None,
asm_compiler_flags: list[str] = [],
asm_compiler_type: None | str = None,
asm_preprocessor: None | str = None,
asm_preprocessor_flags: list[str] = [],
asm_preprocessor_type: None | str = None,
assembler: str,
assembler_flags: list[str] = [],
assembler_preprocessor: None | str = None,
assembler_preprocessor_flags: list[str] = [],
assembler_preprocessor_type: None | str = None,
assembler_type: None | str = None,
binary_extension: None | str = None,
binary_linker_flags: list[str] = [],
bolt: None | str = None,
bolt_enabled: bool = False,
c_compiler: str,
c_compiler_allow_cache_upload: None | bool = None,
c_compiler_flags: list[str] = [],
c_compiler_type: None | str = None,
c_preprocessor_flags: list[str] = [],
cache_links: bool = False,
clang_remarks: None | str = None,
clang_trace: None | bool = None,
compiler_type: None | str = None,
contacts: list[str] = [],
cpp_dep_tracking_mode: str = "makefile",
cuda_compiler: None | str = None,
cuda_compiler_allow_cache_upload: None | bool = None,
cuda_compiler_flags: list[str] = [],
cuda_compiler_type: None | str = None,
cuda_dep_tracking_mode: str = "makefile",
cuda_preprocessor_flags: list[str] = [],
custom_tools: dict[str, str] = {},
cvtres_compiler: None | str = None,
cvtres_compiler_flags: list[str] = [],
cvtres_compiler_type: None | str = None,
cvtres_preprocessor_flags: list[str] = [],
cxx_compiler: str,
cxx_compiler_allow_cache_upload: None | bool = None,
cxx_compiler_flags: list[str] = [],
cxx_compiler_type: None | str = None,
cxx_preprocessor_flags: list[str] = [],
debug_path_prefix_map_sanitizer_format: None | str = None,
default_host_platform: None | str = None,
dist_thin_lto_codegen_flags: list[str] = [],
dwp: None | str = None,
executable_linker_flags: list[str] = [],
gcno_files: bool = False,
generate_linker_maps: bool = False,
headers_as_raw_headers_mode: None | str = None,
hip_compiler: None | str = None,
hip_compiler_flags: list[str] = [],
hip_compiler_type: None | str = None,
hip_preprocessor_flags: list[str] = [],
internal_tools: str = "prelude//cxx/tools:internal_tools",
labels: list[str] = [],
licenses: list[str] = [],
link_metadata_flag: None | str = None,
link_ordering: str = "preorder",
link_style: str = "static",
link_weight: int = 1,
linker: str,
linker_flags: list[str] = [],
linker_type: str,
lipo: None | str = None,
llvm_cgdata: None | str = None,
llvm_link: None | str = None,
lto_mode: str = "none",
min_sdk_version: None | str = None,
nm: str,
objc_compiler_flags: list[str] = [],
objcopy_for_shared_library_interface: str,
objcxx_compiler_flags: list[str] = [],
objdump: None | str = None,
object_file_extension: str = "",
object_format: str = "native",
optimization_compiler_flags_EXPERIMENTAL: list[str] = [],
pic_behavior: str = "supported",
placeholder_tool: None | str = None,
platform_deps_aliases: None | list[str] = None,
platform_name: None | str = None,
post_linker_flags: list[str] = [],
private_headers_symlinks_enabled: bool = True,
public_headers_symlinks_enabled: bool = True,
ranlib: None | str = None,
ranlib_flags: list[str] = [],
raw_headers_as_headers_mode: None | str = None,
rc_compiler: None | str = None,
rc_compiler_flags: list[str] = [],
rc_compiler_type: None | str = None,
rc_preprocessor_flags: list[str] = [],
remap_cwd: bool = False,
requires_archives: bool = False,
requires_objects: bool = False,
sanitizer_runtime_enabled: bool = False,
sanitizer_runtime_files: list[str] = [],
shared_dep_runtime_ld_flags: list[str] = [],
shared_library_extension: str = "",
shared_library_interface_flags: list[str] = [],
shared_library_interface_mode: str = "disabled",
shared_library_interface_producer: None | str = None,
shared_library_interface_type: str,
shared_library_versioned_extension_format: str = "",
split_debug_mode: str = "none",
static_dep_runtime_ld_flags: list[str] = [],
static_library_extension: str = "",
static_pic_dep_runtime_ld_flags: list[str] = [],
strip: str,
strip_all_flags: None | list[str] = None,
strip_debug_flags: None | list[str] = None,
strip_non_global_flags: None | list[str] = None,
supports_distributed_thinlto: bool = False,
supports_two_phase_compilation: bool = False,
target_sdk_version: None | str = None,
thin_lto_double_codegen_enabled: bool = False,
thin_lto_premerger_enabled: bool = False,
use_archiver_flags: bool = True,
use_dep_files: None | bool = None,
use_header_map: bool = False,
) -> None

Parameters

  • name: name of the target
  • default_target_platform: specifies the default target platform, used when no platforms are specified on the command line
  • target_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration
  • compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with a configuration
  • exec_compatible_with: a list of constraints that are required to be satisfied for this target to be compatible with an execution platform
  • visibility: a list of visibility patterns restricting what targets can depend on this one
  • within_view: a list of visibility patterns restricting what this target can depend on
  • metadata: a key-value map of metadata associated with this target
  • tests: a list of targets that provide tests for this one
  • modifiers: an array of modifiers associated with this target
  • binary_linker_flags: Linker flags that apply to all links coordinated by a binary rule. One key distinction between these and executable_linker_flags is that these will also apply to library links coordinated by binary rules (e.g. linking roots/deps when using native python or omnibus link strategies).
  • c_compiler_allow_cache_upload: Whether to allow uploading of object files to cache when the compile action is executed locally and the configuration allows uploads (i.e., there is a cache configured and the client has permission to write to it).
  • cuda_compiler_allow_cache_upload: Whether to allow uploading of object files to cache when the compile action is executed locally and the configuration allows uploads (i.e., there is a cache configured and the client has permission to write to it).
  • cxx_compiler_allow_cache_upload: Whether to allow uploading of object files to cache when the compile action is executed locally and the configuration allows uploads (i.e., there is a cache configured and the client has permission to write to it).
  • executable_linker_flags: Linker flags that only apply when linking an executable.
  • link_style: The default value of the link_style attribute for rules that use this toolchain.
  • raw_headers_as_headers_mode: Controls whether raw_headers and *include_directories attributes should be automatically converted to headers and symlink trees and/or header maps via headers. Only has an effect if the cxx_toolchain has explicitly opted into supporting this behavior via a non-default value, even if the value is disabled.