config_options()¶
The config_options()
method is used to configure or constrain the available options in a package before assigning them a value.
A typical use case is to remove an option in a given platform.
For example, the SSE2
flag doesn’t exist in architectures different than 32 bits, so it should be removed in this method like so:
def config_options(self):
if self.settings.arch != "x86_64":
del self.options.with_sse2
The config_options()
method executes:
Before calling the
configure()
method.Before assigning the
options
values.After
settings
are already defined.
Available automatic implementations¶
Warning
This feature is experimental and subject to breaking changes. See the Conan stability section for more information.
When the config_options()
method is not defined, Conan can automatically manage some
conventional options if specified in the
implements ConanFile attribute: