read_config()
This is liable to change in the future.
Theread_config()
function is used to read .buckconfig
settings from within a build file.Arguments
section
The first argument is the name of the.buckconfig
section with the desired value.field
The second argument is the name of the.buckconfig
field with the desired value.default
(defaults toNone
) The third argument is a value to return if the desired value is not set in the.buckconfig
.
Examples
Useread_config()
to define a custom config setting to enable address sanitizer:cflags = [] sanitizer = read_config('cxx', 'sanitizer') if sanitizer == 'address': cflags.append('-fsanitize=address') cxx_binary( name = 'example', # ... compiler_flags = cflags, )