Skip to main content
Version: 2.18 (deprecated)

cc


Options for a system-discovered cc toolchain.

Backend: pants.backend.experimental.cc

Config section: [cc]

Basic options

c_compiler_flags

--cc-c-compiler-flags="['<str>', '<str>', ...]"
PANTS_CC_C_COMPILER_FLAGS
pants.toml
[cc]
c_compiler_flags = [
'<str>',
'<str>',
...,
]
default:
[
  "-std=c11"
]

Flags passed to the C compiler. These flags are merged with the target-level defines, with the target-level flags taking precedence.

c_definitions

--cc-c-definitions="['<str>', '<str>', ...]"
PANTS_CC_C_DEFINITIONS
pants.toml
[cc]
c_definitions = [
'<str>',
'<str>',
...,
]
default: []

A list of strings to define in the C preprocessor. Will be prefixed by -D at the command line. These defines are merged with the target-level defines, with the target-level definitions taking precedence.

c_executable

--cc-c-executable="['<str>', '<str>', ...]"
PANTS_CC_C_EXECUTABLE
pants.toml
[cc]
c_executable = [
'<str>',
'<str>',
...,
]
default:
[
  "clang",
  "gcc"
]

A list of binary names for the C compiler (in the search_paths). The list is searched in order until a compiler is found.

cxx_compiler_flags

--cc-cxx-compiler-flags="['<str>', '<str>', ...]"
PANTS_CC_CXX_COMPILER_FLAGS
pants.toml
[cc]
cxx_compiler_flags = [
'<str>',
'<str>',
...,
]
default:
[
  "-std=c++11"
]

Flags passed to the C++ compiler. These flags are merged with the target-level defines, with the target-level flags taking precedence.

cxx_definitions

--cc-cxx-definitions="['<str>', '<str>', ...]"
PANTS_CC_CXX_DEFINITIONS
pants.toml
[cc]
cxx_definitions = [
'<str>',
'<str>',
...,
]
default: []

A list of strings to define in the C++ preprocessor. Will be prefixed by -D at the command line. These defines are merged with the target-level defines, with the target-level definitions taking precedence.

cxx_executable

--cc-cxx-executable="['<str>', '<str>', ...]"
PANTS_CC_CXX_EXECUTABLE
pants.toml
[cc]
cxx_executable = [
'<str>',
'<str>',
...,
]
default:
[
  "clang++",
  "g++"
]

A list of binary names for the C compiler (in the search_paths). The list is searched in order until a compiler is found.

include_directories

--cc-include-directories="['<str>', '<str>', ...]"
PANTS_CC_INCLUDE_DIRECTORIES
pants.toml
[cc]
include_directories = [
'<str>',
'<str>',
...,
]
default: []

A list of include directories passed to the compiler. Will be prefixed by -I at the command line. These flags are merged with the target-level includes, with the target-level includes taking precedence.

search_paths

--cc-search-paths="['<str>', '<str>', ...]"
PANTS_CC_SEARCH_PATHS
pants.toml
[cc]
search_paths = [
'<str>',
'<str>',
...,
]
default:
[
  "<PATH>"
]

A list of paths to search for CC toolchain binaries.

Specify absolute paths to directories, e.g. /usr/bin. Earlier entries will be searched first.

The following special strings are supported:

  • <PATH>, the contents of the PATH environment variable

Advanced options

None

Deprecated options

None

None