Skip to content

Commit 1a7521c

Browse files
committed
update docs
1 parent f5d0513 commit 1a7521c

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed

docs/api/scripts/option-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ option:set("configvar", option:name(), option:value(), {quote = false})
3838

3939
::: tip NOTE
4040
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.
41+
42+
For example:
43+
- Description scope: `set_default(false)`
44+
- Script scope: `option:set("default", false)`
4145
:::
4246

4347
## option:add
@@ -53,6 +57,10 @@ option:add("defines", "SDL_MAIN_HANDLED")
5357

5458
::: tip NOTE
5559
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.
60+
61+
For example:
62+
- Description scope: `add_defines("DEBUG", "VERSION=1")`
63+
- Script scope: `option:add("defines", "DEBUG", "VERSION=1")`
5664
:::
5765

5866
::: tip NOTE

docs/api/scripts/package-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ package:set("defines", "SDL_MAIN_HANDLED")
3636

3737
::: tip NOTE
3838
Any script scope configuration using `package: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.
39+
40+
For example:
41+
- Description scope: `set_urls("https://github.com/madler/zlib/archive/$(version).tar.gz")`
42+
- Script scope: `package:set("urls", "https://github.com/madler/zlib/archive/$(version).tar.gz")`
3943
:::
4044

4145
## package:add
@@ -53,6 +57,10 @@ package:add("defines", "SDL_MAIN_HANDLED")
5357

5458
::: tip NOTE
5559
Any script scope configuration using `package: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.
60+
61+
For example:
62+
- Description scope: `add_deps("zlib", {configs = {shared = true}})`
63+
- Script scope: `package:add("deps", "zlib", {configs = {shared = true}})`
5664
:::
5765

5866
## package:license

docs/api/scripts/target-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ target:set("defines", "SDL_MAIN_HANDLED")
3232

3333
::: tip NOTE
3434
Any script scope configuration using `target: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.
35+
36+
For example:
37+
- Description scope: `set_kind("binary")`
38+
- Script scope: `target:set("kind", "binary")`
3539
:::
3640

3741
## target:add
@@ -47,6 +51,10 @@ target:add("defines", "SDL_MAIN_HANDLED")
4751

4852
::: tip NOTE
4953
Any script scope configuration using `target: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.
54+
55+
For example:
56+
- Description scope: `add_files("src/*.c", {defines = "PRIVATE"})`
57+
- Script scope: `target:add("files", "src/*.c", {defines = "PRIVATE"})`
5058
:::
5159

5260
## target:kind

docs/zh/api/scripts/option-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ option:set("configvar", option:name(), option:value(), {quote = false})
4141

4242
::: tip 注意
4343
任何脚本域下对 `option:set("xxx", ...)` 的配置,都是完全跟描述域的 `set_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `set_xxx` 接口说明。
44+
45+
例如:
46+
- 描述域:`set_default(false)`
47+
- 脚本域:`option:set("default", false)`
4448
:::
4549

4650
## option:add
@@ -56,6 +60,10 @@ option:add("defines", "SDL_MAIN_HANDLED")
5660

5761
::: tip 注意
5862
任何脚本域下对 `option:add("xxx", ...)` 的配置,都是完全跟描述域的 `add_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `add_xxx` 接口说明。
63+
64+
例如:
65+
- 描述域:`add_defines("DEBUG", "VERSION=1")`
66+
- 脚本域:`option:add("defines", "DEBUG", "VERSION=1")`
5967
:::
6068

6169
::: tip 注意

docs/zh/api/scripts/package-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ package:set("defines", "SDL_MAIN_HANDLED")
3838

3939
::: tip 注意
4040
任何脚本域下对 `package:set("xxx", ...)` 的配置,都是完全跟描述域的 `set_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `set_xxx` 接口说明。
41+
42+
例如:
43+
- 描述域:`set_urls("https://github.com/madler/zlib/archive/$(version).tar.gz")`
44+
- 脚本域:`package:set("urls", "https://github.com/madler/zlib/archive/$(version).tar.gz")`
4145
:::
4246

4347
## package:add
@@ -55,6 +59,10 @@ package:add("defines", "SDL_MAIN_HANDLED")
5559

5660
::: tip 注意
5761
任何脚本域下对 `package:add("xxx", ...)` 的配置,都是完全跟描述域的 `add_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `add_xxx` 接口说明。
62+
63+
例如:
64+
- 描述域:`add_deps("zlib", {configs = {shared = true}})`
65+
- 脚本域:`package:add("deps", "zlib", {configs = {shared = true}})`
5866
:::
5967

6068
## package:license

docs/zh/api/scripts/target-instance.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ target:set("defines", "SDL_MAIN_HANDLED")
3434

3535
::: tip 注意
3636
任何脚本域下对 `target:set("xxx", ...)` 的配置,都是完全跟描述域的 `set_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `set_xxx` 接口说明。
37+
38+
例如:
39+
- 描述域:`set_kind("binary")`
40+
- 脚本域:`target:set("kind", "binary")`
3741
:::
3842

3943
## target:add
@@ -49,6 +53,10 @@ target:add("defines", "SDL_MAIN_HANDLED")
4953

5054
::: tip 注意
5155
任何脚本域下对 `target:add("xxx", ...)` 的配置,都是完全跟描述域的 `add_xxx` 接口保持一致的,具体参数说明,可以直接参考描述域下对应的 `add_xxx` 接口说明。
56+
57+
例如:
58+
- 描述域:`add_files("src/*.c", {defines = "PRIVATE"})`
59+
- 脚本域:`target:add("files", "src/*.c", {defines = "PRIVATE"})`
5260
:::
5361

5462
## target:kind

0 commit comments

Comments
 (0)