IMPORTANT: The Bazel docs have moved! Please update your bookmark to https://bazel.build/rules/lib/CompilationContext
You can read about the migration, and let us know what you think.
Extensions >
API reference >
CompilationContext
CompilationContext
Immutable store of information needed for C++ compilation that is aggregated across dependencies.Members
defines
depset CompilationContext.definesReturns the set of defines needed to compile this target. Each define is a string. These values are propagated to the target's transitive dependents, that is, any rules that depend on this target.
direct_headers
list CompilationContext.direct_headersReturns the list of modular headers that are declared by this target. This includes both public headers (such as those listed in "hdrs") and private headers (such as those listed in "srcs").
direct_private_headers
list CompilationContext.direct_private_headersReturns the list of modular private headers (those listed in "srcs") that are declared by this target.
direct_public_headers
list CompilationContext.direct_public_headersReturns the list of modular public headers (those listed in "hdrs") that are declared by this target.
direct_textual_headers
list CompilationContext.direct_textual_headersReturns the list of textual headers that are declared by this target.
framework_includes
depset CompilationContext.framework_includesReturns the set of search paths (as strings) for framework header files. Usually passed with -F.
headers
depset CompilationContext.headersReturns the set of headers needed to compile this target.
includes
depset CompilationContext.includesReturns the set of search paths (as strings) for header files referenced both by angle bracket and quotes. Usually passed with -I.
local_defines
depset CompilationContext.local_definesReturns the set of defines needed to compile this target. Each define is a string. These values are not propagated to the target's transitive dependents.
quote_includes
depset CompilationContext.quote_includesReturns the set of search paths (as strings) for header files referenced by quotes, e.g. #include "foo/bar/header.h". They can be either relative to the exec root or absolute. Usually passed with -iquote.
system_includes
depset CompilationContext.system_includesReturns the set of search paths (as strings) for header files referenced by angle brackets, e.g. #include <foo/bar/header.h>. They can be either relative to the exec root or absolute. Usually passed with -isystem.
validation_artifacts
depset CompilationContext.validation_artifactsReturns the set of validation artifacts.