Ver Fonte

rename toolsets to toolset

ruki há 5 anos atrás
pai
commit
9b5c380463

+ 15 - 15
guide/configuration.md

@@ -243,7 +243,7 @@ $ xmake f -p linux --sdk=/usr/toolsdk --cflags="-DTEST -I/xxx/xxx" --ldflags="-l
 
 #### set_toolchains
 
-This sets up different tool chains for a specific target individually. Unlike set_toolsets, this interface is an overall switch for a complete tool chain, such as cc/ld/sh and a series of tool sets.
+This sets up different tool chains for a specific target individually. Unlike set_toolset, this interface is an overall switch for a complete tool chain, such as cc/ld/sh and a series of tool sets.
 
 This is also a recommended practice, because most compiler tool chains like gcc/clang, the compiler and the linker are used together. To cut it, you have to cut it as a whole. Separate and scattered switch settings will be cumbersome.
 
@@ -256,15 +256,15 @@ target("test")
     set_toolchains("clang", "yasm")
 ```
 
-#### set_toolsets
+#### set_toolset
 
-If you feel that it is more complicated to configure through the command line each time, some configurations can be pre-configured in xmake.lua to simplify the command configuration. For example, the specification of the compiler can be set individually for each target through set_toolsets.
+If you feel that it is more complicated to configure through the command line each time, some configurations can be pre-configured in xmake.lua to simplify the command configuration. For example, the specification of the compiler can be set individually for each target through set_toolset.
 
 ```lua
 target("test")
     set_kind("binary")
-    set_toolsets("cxx", "clang")
-    set_toolsets("ld", "clang++")
+    set_toolset("cxx", "clang")
+    set_toolset("ld", "clang++")
 ```
 
 Force the compiler and linker of the test target to use the clang compiler, or specify the compiler name or path in the cross-compilation tool chain.
@@ -401,16 +401,16 @@ In addition, we can also customize the toolchain in xmake.lua, and then specify
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     - ...
 ```

+ 31 - 31
manual/custom_toolchain.md

@@ -8,17 +8,17 @@ toolchain("myclang")
     -- mark as standalone toolchain
     set_kind("standalone")
         
-    -- set toolsets
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    -- set toolset
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     add_defines("MYCLANG")
 
@@ -78,7 +78,7 @@ The following is a list of interfaces currently supported by the custom toolchai
 | -----------------------------------------------                        | - ------------------------------------------- | ------ -          |
 | [toolchain](#toolchain)                                                | Define Toolchain                              | >= 2.3.4          |
 | [set_kind](#toolchainset_kind)                                         | Set toolchain type                            | >= 2.3.4          |
-| [set_toolsets](#toolchainset_toolsets)                                 | Set toolset                                   | >= 2.3.4          |
+| [set_toolset](#toolchainset_toolset)                                 | Set toolset                                   | >= 2.3.4          |
 | [set_sdkdir](#toolchainset_sdkdir)                                     | Set toolchain sdk directory path              | >= 2.3.4          |
 | [set_bindir](#toolchainset_bindir)                                     | Set toolchain bin directory path              | >= 2.3.4          |
 | [on_check](#toolchainon_check)                                         | Check toolchain                               | >= 2.3.4          |
@@ -115,8 +115,8 @@ It can be defined in the user project xmake.lua, or it can be independently defi
 
 ```lua
 toolchain("myclang")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
 toolchain_end()
 ```
 
@@ -132,7 +132,7 @@ However, local toolchains such as yasm/nasm belong to the extension of additiona
 
 !> Just remember that the toolchain with a complete compilation environment is set to standalone
 
-### toolchain:set_toolsets
+### toolchain:set_toolset
 
 #### Set Tool Set
 
@@ -141,19 +141,19 @@ Used to set the name and path of each individual tool, for example:
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 ```
 
-For details about this interface, you can see: [target.set_toolsets](/manual/project_target?id=targetset_toolsets)
+For details about this interface, you can see: [target.set_toolset](/manual/project_target?id=targetset_toolset)
 
 ### toolchain:set_sdkdir
 
@@ -165,7 +165,7 @@ Usually we can configure the sdk directory through `xmake f --toolchain=myclang
 toolchain("myclang")
     set_kind("standalone")
     set_sdkdir("/tmp/sdkdir")
-    set_toolsets("cc", "clang")
+    set_toolset("cc", "clang")
 ```
 
 ### toolchain:set_bindir
@@ -178,7 +178,7 @@ Normally, we can configure the SDK directory through `xmake f --toolchain=myclan
 toolchain("myclang")
     set_kind("standalone")
     set_bindir("/tmp/sdkdir/bin")
-    set_toolsets("cc", "clang")
+    set_toolset("cc", "clang")
 ```
 
 ### toolchain:on_check
@@ -207,9 +207,9 @@ toolchain("myclang")
     set_kind("standalone")
     on_load(function (toolchain)
         
-        - set toolsets
-        toolchain:set("toolsets", "cc", "clang")
-        toolchain:set("toolsets", "ld", "clang++")
+        - set toolset
+        toolchain:set("toolset", "cc", "clang")
+        toolchain:set("toolset", "ld", "clang++")
         - ..
 
         - get march

+ 16 - 16
manual/project_target.md

@@ -105,7 +105,7 @@ target("test2")
 | [add_vectorexts](#targetadd_vectorexts)         | Add vector extensions                                  | >= 1.0.1                    |
 | [add_frameworks](#targetadd_frameworks)         | Add frameworks                                         | >= 2.1.1                    |
 | [add_frameworkdirs](#targetadd_frameworkdirs)   | Add framework search directories                       | >= 2.1.5                    |
-| [set_toolsets](#targetset_toolsets)             | Set toolsets                                           | >= 2.3.4                    |
+| [set_toolset](#targetset_toolset)             | Set toolset                                           | >= 2.3.4                    |
 | [set_toolchains](#targetset_toolchains)         | Set toolchains                                         | >= 2.3.4                    |
 | [set_values](#targetset_values)                 | Set custom configuration values                        | >= 2.2.1                    |
 | [add_values](#targetadd_values)                 | Add custom configuration values                        | >= 2.2.1                    |
@@ -1771,9 +1771,9 @@ target("test")
     add_frameworkdirs("/tmp/frameworkdir", "/tmp/frameworkdir2")
 ```
 
-### target:set_toolsets
+### target:set_toolset
 
-#### Set toolsets
+#### Set toolset
 
 Separate settings for a specific target to switch a compiler, linker, but we recommend using [set_toolchains](#targetset_toolchains) to switch the overall tool chain of a target.
 
@@ -1791,7 +1791,7 @@ target("test1")
 
 target("test2")
     add_files("*.c")
-    set_toolsets("cc", "$(projectdir)/tools/bin/clang-5.0")
+    set_toolset("cc", "$(projectdir)/tools/bin/clang-5.0")
 ```
 
 The above description only makes special settings for the compiler of the test2 target, compiling test2 with a specific clang-5.0 compiler, and test1 still uses the default settings.
@@ -1822,14 +1822,14 @@ The previous parameter is key, which is used to specify the tool type. Currently
 For some compiler file names that are irregular, causing xmake to fail to recognize the known compiler name, we can also add a tool name prompt, for example:
 
 ```lua
-set_toolsets("cc", "gcc@$(projectdir)/tools/bin/Mipscc.exe")
+set_toolset("cc", "gcc@$(projectdir)/tools/bin/Mipscc.exe")
 ```
 
 ### target:set_toolchains
 
 #### Set up the toolchain
 
-This sets up different tool chains for a specific target individually. Unlike set_toolsets, this interface is an overall switch for a complete tool chain, such as cc/ld/sh and a series of tool sets.
+This sets up different tool chains for a specific target individually. Unlike set_toolset, this interface is an overall switch for a complete tool chain, such as cc/ld/sh and a series of tool sets.
 
 This is also a recommended practice, because most compiler tool chains like gcc/clang, the compiler and the linker are used together. To cut it, you have to cut it as a whole. Separate and scattered switch settings will be cumbersome.
 
@@ -1878,16 +1878,16 @@ In addition, we can also customize toolchain in xmake.lua, and then specify it t
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     - ...
 ```

+ 15 - 15
zh-cn/guide/configuration.md

@@ -239,7 +239,7 @@ $ xmake f -p linux --sdk=/usr/toolsdk --cflags="-DTEST -I/xxx/xxx" --ldflags="-l
 
 #### set_toolchains
 
-这对某个特定的target单独切换设置不同的工具链,和set_toolsets不同的是,此接口是对完整工具链的整体切换,比如cc/ld/sh等一系列工具集。
+这对某个特定的target单独切换设置不同的工具链,和set_toolset不同的是,此接口是对完整工具链的整体切换,比如cc/ld/sh等一系列工具集。
 
 这也是推荐做法,因为像gcc/clang等大部分编译工具链,编译器和链接器都是配套使用的,要切就得整体切,单独零散的切换设置会很繁琐。
 
@@ -252,15 +252,15 @@ target("test")
     set_toolchains("clang", "yasm")
 ```
 
-#### set_toolsets
+#### set_toolset
 
-如果觉得每次通过命令行配置比较繁琐,有些配置可以通过在xmake.lua预先配置好,来简化命令配置,比如编译器的指定,就可以通过`set_toolsets`来对每个target单独设置。
+如果觉得每次通过命令行配置比较繁琐,有些配置可以通过在xmake.lua预先配置好,来简化命令配置,比如编译器的指定,就可以通过`set_toolset`来对每个target单独设置。
 
 ```lua
 target("test")
     set_kind("binary")
-    set_toolsets("cxx", "clang")
-    set_toolsets("ld", "clang++")
+    set_toolset("cxx", "clang")
+    set_toolset("ld", "clang++")
 ```
 
 强制test目标的编译器和链接器使用clang编译器,或者指定交叉编译工具链中的编译器名或者路径。
@@ -397,16 +397,16 @@ fasm          Flat Assembler
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     -- ...
 ```

+ 31 - 31
zh-cn/manual/custom_toolchain.md

@@ -8,17 +8,17 @@ toolchain("myclang")
     -- mark as standalone toolchain
     set_kind("standalone")
         
-    -- set toolsets
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    -- set toolset
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     add_defines("MYCLANG")
 
@@ -78,7 +78,7 @@ $ xmake show -l toolchains
 | -----------------------------------------------                              | -------------------------------------------- | -------- |
 | [toolchain](#toolchain)                                                      | 定义工具链                                   | >= 2.3.4 |
 | [set_kind](#toolchainset_kind)                                               | 设置工具链类型                               | >= 2.3.4 |
-| [set_toolsets](#toolchainset_toolsets)                                       | 设置工具集                                   | >= 2.3.4 |
+| [set_toolset](#toolchainset_toolset)                                       | 设置工具集                                   | >= 2.3.4 |
 | [set_sdkdir](#toolchainset_sdkdir)                                           | 设置工具链sdk目录路径                        | >= 2.3.4 |
 | [set_bindir](#toolchainset_bindir)                                           | 设置工具链bin目录路径                        | >= 2.3.4 |
 | [on_check](#toolchainon_check)                                               | 检测工具链                                   | >= 2.3.4 |
@@ -115,8 +115,8 @@ $ xmake show -l toolchains
 
 ```lua
 toolchain("myclang")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
 toolchain_end()
 ```
 
@@ -132,7 +132,7 @@ toolchain_end()
 
 !> 只要记住,存在完整编译环境的工具链,都设置为standalone就行了
 
-### toolchain:set_toolsets
+### toolchain:set_toolset
 
 #### 设置工具集
 
@@ -141,19 +141,19 @@ toolchain_end()
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 ```
 
-关于这个接口的详情,可以看下:[target.set_toolsets](/zh-cn/manual/project_target?id=targetset_toolsets)
+关于这个接口的详情,可以看下:[target.set_toolset](/zh-cn/manual/project_target?id=targetset_toolset)
 
 ### toolchain:set_sdkdir
 
@@ -165,7 +165,7 @@ toolchain("myclang")
 toolchain("myclang")
     set_kind("standalone")
     set_sdkdir("/tmp/sdkdir")
-    set_toolsets("cc", "clang")
+    set_toolset("cc", "clang")
 ```
 
 ### toolchain:set_bindir
@@ -178,7 +178,7 @@ toolchain("myclang")
 toolchain("myclang")
     set_kind("standalone")
     set_bindir("/tmp/sdkdir/bin")
-    set_toolsets("cc", "clang")
+    set_toolset("cc", "clang")
 ```
 
 ### toolchain:on_check
@@ -207,9 +207,9 @@ toolchain("myclang")
     set_kind("standalone")
     on_load(function (toolchain)
         
-        -- set toolsets
-        toolchain:set("toolsets", "cc", "clang")
-        toolchain:set("toolsets", "ld", "clang++")
+        -- set toolset
+        toolchain:set("toolset", "cc", "clang")
+        toolchain:set("toolset", "ld", "clang++")
         -- ..
 
         -- get march

+ 15 - 15
zh-cn/manual/project_target.md

@@ -106,7 +106,7 @@ target("test2")
 | [add_vectorexts](#targetadd_vectorexts)         | 添加向量扩展指令                     | >= 1.0.1 |
 | [add_frameworks](#targetadd_frameworks)         | 添加链接框架                         | >= 2.1.1 |
 | [add_frameworkdirs](#targetadd_frameworkdirs)   | 添加链接框架的搜索目录               | >= 2.1.5 |
-| [set_toolsets](#targetset_toolsets)             | 设置工具集                           | >= 2.3.4 |
+| [set_toolset](#targetset_toolset)             | 设置工具集                           | >= 2.3.4 |
 | [set_toolchains](#targetset_toolchains)         | 设置工具链                           | >= 2.3.4 |
 | [set_values](#targetset_values)                 | 设置一些扩展配置值                   | >= 2.2.1 |
 | [add_values](#targetadd_values)                 | 添加一些扩展配置值                   | >= 2.2.1 |
@@ -1768,7 +1768,7 @@ target("test")
     add_frameworkdirs("/tmp/frameworkdir", "/tmp/frameworkdir2")
 ```
 
-### target:set_toolsets
+### target:set_toolset
 
 #### 设置工具集
 
@@ -1788,7 +1788,7 @@ target("test1")
 
 target("test2")
     add_files("*.c")
-    set_toolsets("cc", "$(projectdir)/tools/bin/clang-5.0")
+    set_toolset("cc", "$(projectdir)/tools/bin/clang-5.0")
 ```
 
 上述描述仅对test2目标的编译器进行特殊设置,使用特定的clang-5.0编译器来编译test2,而test1还是使用默认设置。
@@ -1819,7 +1819,7 @@ target("test2")
 对于一些编译器文件名不规则,导致xmake无法正常识别处理为已知的编译器名的情况下,我们也可以加一个工具名提示,例如:
 
 ```lua
-set_toolsets("cc", "gcc@$(projectdir)/tools/bin/mipscc.exe")
+set_toolset("cc", "gcc@$(projectdir)/tools/bin/mipscc.exe")
 ```
 
 上述描述设置mipscc.exe作为c编译器,并且提示xmake作为gcc的传参处理方式进行编译。
@@ -1828,7 +1828,7 @@ set_toolsets("cc", "gcc@$(projectdir)/tools/bin/mipscc.exe")
 
 #### 设置工具链
 
-这对某个特定的target单独切换设置不同的工具链,和set_toolsets不同的是,此接口是对完整工具链的整体切换,比如cc/ld/sh等一系列工具集。
+这对某个特定的target单独切换设置不同的工具链,和set_toolset不同的是,此接口是对完整工具链的整体切换,比如cc/ld/sh等一系列工具集。
 
 这也是推荐做法,因为像gcc/clang等大部分编译工具链,编译器和链接器都是配套使用的,要切就得整体切,单独零散的切换设置会很繁琐。
 
@@ -1877,16 +1877,16 @@ $ xmake
 ```lua
 toolchain("myclang")
     set_kind("standalone")
-    set_toolsets("cc", "clang")
-    set_toolsets("cxx", "clang", "clang++")
-    set_toolsets("ld", "clang++", "clang")
-    set_toolsets("sh", "clang++", "clang")
-    set_toolsets("ar", "ar")
-    set_toolsets("ex", "ar")
-    set_toolsets("strip", "strip")
-    set_toolsets("mm", "clang")
-    set_toolsets("mxx", "clang", "clang++")
-    set_toolsets("as", "clang")
+    set_toolset("cc", "clang")
+    set_toolset("cxx", "clang", "clang++")
+    set_toolset("ld", "clang++", "clang")
+    set_toolset("sh", "clang++", "clang")
+    set_toolset("ar", "ar")
+    set_toolset("ex", "ar")
+    set_toolset("strip", "strip")
+    set_toolset("mm", "clang")
+    set_toolset("mxx", "clang", "clang++")
+    set_toolset("as", "clang")
 
     -- ...
 ```