CcToolchainInfo
Information about the C++ compiler being used.Methods
- ar_executable
- built_in_include_directories
- c_options
- compiler
- compiler_executable
- compiler_options
- cpu
- cxx_options
- dynamic_link_options
- fully_static_link_options
- ld_executable
- libc
- link_options_do_not_use
- mostly_static_link_options
- nm_executable
- objcopy_executable
- objdump_executable
- preprocessor_executable
- strip_executable
- sysroot
- target_gnu_system_name
- to_json
- to_proto
- unfiltered_compiler_options
ar_executable
string CcToolchainInfo.ar_executable()Path to GNU binutils 'ar' binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will be removed soon as part of the new Skylark API to the C++ toolchain.
built_in_include_directories
list CcToolchainInfo.built_in_include_directoriesReturns the list of built-in directories of the compiler.
c_options
list CcToolchainInfo.c_options()Returns the list of additional C-specific options to use for compiling C. These should be go on the command line after the common options returned by
compiler_options
compiler
string CcToolchainInfo.compilerC++ compiler. May return
None
.
compiler_executable
string CcToolchainInfo.compiler_executable()Path to C/C++ compiler binary. WARNING: This method is only added to allow incremental migration of existing users. Please do not use in new code. Will beremoved soon as part of the new Skylark API to the C++ toolchain.
compiler_options
list CcToolchainInfo.compiler_options()Returns the default options to use for compiling C, C++, and assembler. This is just the options that should be used for all three languages. There may be additional C-specific or C++-specific options that should be used, in addition to the ones returned by this method
cpu
string CcToolchainInfo.cpuTarget CPU of the C++ toolchain. May return
None
.
cxx_options
list CcToolchainInfo.cxx_options()Returns the list of additional C++-specific options to use for compiling C++. These should be go on the command line after the common options returned by
compiler_options
dynamic_link_options
list CcToolchainInfo.dynamic_link_options(shared_lib)Returns the immutable list of linker options for artifacts that are not fully or mostly statically linked. Does not include command-line options passed via --linkopt or --linkopts.
Parameters
Parameter | Description |
---|---|
shared_lib
|
If true, returns the link options for a shared library. |
fully_static_link_options
list CcToolchainInfo.fully_static_link_options(shared_lib)Returns the immutable list of linker options for fully statically linked outputs. Does not include command-line options passed via --linkopt or --linkopts.
Parameters
Parameter | Description |
---|---|
shared_lib
|
If true, returns the link options for a shared library. |
ld_executable
string CcToolchainInfo.ld_executable()Path to the linker binary. WARNING: This method is only added to allow incrementalmigration of existing users. Please do not use in new code. Will be removed soonas part of the new Skylark API to the C++ toolchain.
libc
string CcToolchainInfo.libclibc version string. May return
None
.
link_options_do_not_use
list CcToolchainInfo.link_options_do_not_useReturns the set of command-line linker options, including any flags inferred from the command-line options.
mostly_static_link_options
list CcToolchainInfo.mostly_static_link_options(shared_lib)Returns the immutable list of linker options for mostly statically linked outputs. Does not include command-line options passed via --linkopt or --linkopts.
Parameters
Parameter | Description |
---|---|
shared_lib
|
If true, returns the link options for a shared library. |
nm_executable
string CcToolchainInfo.nm_executable()Path to GNU binutils 'nm' binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will be removed soon as part of the new Skylark API to the C++ toolchain.
objcopy_executable
string CcToolchainInfo.objcopy_executable()Path to GNU binutils 'objcopy' binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will beremoved soon as part of the new Skylark API to the C++ toolchain.
objdump_executable
string CcToolchainInfo.objdump_executable()Path to GNU binutils 'objdump' binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will be removed soon as part of the new Skylark API to the C++ toolchain.
preprocessor_executable
string CcToolchainInfo.preprocessor_executable()Path to C/C++ preprocessor binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will be removed soon as part of the new Skylark API to the C++ toolchain.
strip_executable
string CcToolchainInfo.strip_executable()Path to GNU binutils 'strip' binary. WARNING: This method is only added to allowincremental migration of existing users. Please do not use in new code. Will be removed soon as part of the new Skylark API to the C++ toolchain.
sysroot
string CcToolchainInfo.sysrootReturns 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
string CcToolchainInfo.target_gnu_system_nameThe GNU System Name. May return
None
.
to_json
string CcToolchainInfo.to_json()Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:
struct(key=123).to_json() # {"key":123} struct(key=True).to_json() # {"key":true} struct(key=[1, 2, 3]).to_json() # {"key":[1,2,3]} struct(key='text').to_json() # {"key":"text"} struct(key=struct(inner_key='text')).to_json() # {"key":{"inner_key":"text"}} struct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json() # {"key":[{"inner_key":1},{"inner_key":2}]} struct(key=struct(inner_key=struct(inner_inner_key='text'))).to_json() # {"key":{"inner_key":{"inner_inner_key":"text"}}}
to_proto
string CcToolchainInfo.to_proto()Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or a list of these types. Quotes and new lines in strings are escaped. Keys are iterated in the sorted order. Examples:
struct(key=123).to_proto() # key: 123 struct(key=True).to_proto() # key: true struct(key=[1, 2, 3]).to_proto() # key: 1 # key: 2 # key: 3 struct(key='text').to_proto() # key: "text" struct(key=struct(inner_key='text')).to_proto() # key { # inner_key: "text" # } struct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto() # key { # inner_key: 1 # } # key { # inner_key: 2 # } struct(key=struct(inner_key=struct(inner_inner_key='text'))).to_proto() # key { # inner_key { # inner_inner_key: "text" # } # }
unfiltered_compiler_options
list CcToolchainInfo.unfiltered_compiler_options(features)Deprecated. Returns the default list of options which cannot be filtered by BUILD rules. These should be appended to the command line after filtering.
Parameters
Parameter | Description |
---|---|
features
|
Unused. |