Selaa lähdekoodia

update set_toolchains

ruki 2 kuukautta sitten
vanhempi
sitoutus
e4ff968499

+ 12 - 0
docs/api/description/project-target.md

@@ -2534,6 +2534,18 @@ The above effect is similar to `set_toolchains("msvc", {vs = "2015", arch = "x86
 
 Generally, we recommend using `set_arch` to switch the architecture of the entire target.
 
+Since v3.0.4, for the mingw toolchain, we can specify a particular MSYS2 environment using the `msystem` parameter, for example:
+
+```lua
+target("ucrt64")
+    set_arch("x86_64")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("mingw", {msystem = "ucrt64"})
+```
+
+This allows xmake to use the mingw toolchain from the specified MSYS2 environment (ucrt64 in this case). Supported msystem values include: `mingw32`, `mingw64`, `ucrt64`, `clang64`, etc.
+
 ## set_plat
 
 ### Set the compilation platform for the specified target

+ 12 - 0
docs/zh/api/description/project-target.md

@@ -2522,6 +2522,18 @@ target("test")
 
 通常,我们更推荐使用 `set_arch` 来对整个target实现架构切换。
 
+v3.0.4 以上版本,对于 mingw 工具链,我们还可以通过 `msystem` 参数来指定使用特定的 MSYS2 环境,例如:
+
+```lua
+target("ucrt64")
+    set_arch("x86_64")
+    set_kind("binary")
+    add_files("src/*.c")
+    set_toolchains("mingw", {msystem = "ucrt64"})
+```
+
+这样可以让 xmake 使用 MSYS2 的 ucrt64 环境中的 mingw 工具链来编译,支持的 msystem 值包括:`mingw32`、`mingw64`、`ucrt64`、`clang64` 等。
+
 ## set_plat
 
 ### 设置指定目标的编译平台