diff options
| author | ruki <waruqi@gmail.com> | 2018-08-11 00:46:01 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-08-10 22:36:08 +0800 |
| commit | 96e0ba81e20fa68d973ac84c01ead139118c072a (patch) | |
| tree | 5477b05cca91dc1170603fbe2f70749a2681e392 /manual.md | |
| parent | 985a057cfd771c45d49727b15507f1a6ffbb451f (diff) | |
| download | xmake-docs-96e0ba81e20fa68d973ac84c01ead139118c072a.tar.gz xmake-docs-96e0ba81e20fa68d973ac84c01ead139118c072a.zip | |
modify title orders
Diffstat (limited to 'manual.md')
| -rw-r--r-- | manual.md | 72 |
1 files changed, 36 insertions, 36 deletions
@@ -240,6 +240,42 @@ if is_option("demo") then end ``` +##### is_config + +###### Is the given config values? + +This interface is introduced from version 2.2.2 to determine whether the specified configuration is a given value. + +For example: + +```console +$ xmake f --test=hello1 +``` + +```lua +option("test") + set_showmenu("true") + set_description("The test config option") +option_end() + +if is_config("test", "hello1", "hello2") then + add_defines("HELLO") +end +``` + +Not only that, we can also set pattern matching rules to determine values, such as: + +```lua +if is_config("test", "hello.*") then + add_defines("HELLO") +end +``` + +<p class="tips"> +This interface is not only able to determine the custom options defined through the [option](#option), +but also to determine the built-in global and local configuration. +</p> + ##### has_config ###### Is the given configs enabled? @@ -278,42 +314,6 @@ This interface can determine not only the built-in global and local configs, but also the custom options defined through the [option](#option). </p> -##### is_config - -###### Is the given config values? - -This interface is introduced from version 2.2.2 to determine whether the specified configuration is a given value. - -For example: - -```console -$ xmake f --test=hello1 -``` - -```lua -option("test") - set_showmenu("true") - set_description("The test config option") -option_end() - -if is_config("test", "hello1", "hello2") then - add_defines("HELLO") -end -``` - -Not only that, we can also set pattern matching rules to determine values, such as: - -```lua -if is_config("test", "hello.*") then - add_defines("HELLO") -end -``` - -<p class="tips"> -This interface is not only able to determine the custom options defined through the [option](#option), -but also to determine the built-in global and local configuration. -</p> - #### Global Interfaces The global interface affects the whole project description scope and all sub-project files. |
