This is a mirror page, please see the original page:

https://xmake.io/#/zh-cn/manual/option_instance

此页面描述了 配置选项on_load()on_check()after_check() 等函数的 option 接口

option:name

option:get

任何在描述域的 set_xxxadd_xxx 配置值都可以通过这个接口获取到。

-- get the links
option:get("links")
-- get the defined macros
option:get("defines")

option:set

-- set the links
option:set("links", "sdl2")
-- set the defined macros
option:set("defines", "SDL_MAIN_HANDLED")

option:add

-- add links
option:add("links", "sdl2")
-- add defined macros
option:add("defines", "SDL_MAIN_HANDLED")

!> 此处文档还在进行中,请耐心等待,你也可以通过赞助或者提 pr 来加速文档的更新