This page describes the interface for option of functions like on_load(), on_check() or after_check() of the Configuration option
Get the values of the option by name
-- get the links
option:get("links")
-- get the defined macros
option:get("defines")
If you just want to add values use option:add.
-- set the links
option:set("links", "sdl2")
-- set the defined macros
option:set("defines", "SDL_MAIN_HANDLED")
-- set configvar
option:set("configvar", option:name(), option:value(), {quote = false})
::: tip NOTE
Any script scope configuration using option:set("xxx", ...) is completely consistent with the corresponding set_xxx interface in the description scope. For specific parameter descriptions, you can directly refer to the corresponding set_xxx interface documentation in the description scope.
For example:
set_default(false)option:set("default", false)
:::Add to the values of the option by name
-- add links
option:add("links", "sdl2")
-- add defined macros
option:add("defines", "SDL_MAIN_HANDLED")
::: tip NOTE
Any script scope configuration using option:add("xxx", ...) is completely consistent with the corresponding add_xxx interface in the description scope. For specific parameter descriptions, you can directly refer to the corresponding add_xxx interface documentation in the description scope.
For example:
add_defines("DEBUG", "VERSION=1")option:add("defines", "DEBUG", "VERSION=1")
:::::: tip NOTE The document here is still in progress, please be patient, you can also speed up the update of the document by sponsoring or submiting pr :::