ruki 6 mēneši atpakaļ
vecāks
revīzija
bab50bcaae

+ 1 - 1
docs/guide/introduction.md

@@ -2,7 +2,7 @@
 
 ## What is Xmake?
 
-Xmake is a lightweight, cross-platform build utility based on Lua. It uses a Lua script to maintain project builds, but is driven by a dependency-free core program written in C. Compared with Makefiles or CMake, the configuration syntax is much more concise and intuitive. As such, it's friendly to novices while still maintaining the flexibility required in a build system. With Xmake, you can focus on your project instead of the build.
+Xmake is a lightweight, cross-platform build utility based on Lua. It uses a Lua script to maintain project builds, but is driven by a dependency-free core program written in C. Compared with Makefiles or CMake, the configuration syntax is much more concise and intuitive. As such, it's friendly to novices while still maintaining the flexibility required in a build system. With Xmake, you can focus on your project instead of the build system.
 
 Xmake can be used to directly build source code (like with Make or Ninja), or it can generate project files like CMake or Meson. It also has a *built-in* package management system to help users integrate C/C++ dependencies.
 

+ 11 - 12
docs/guide/project-configuration/configure-targets.md

@@ -10,11 +10,11 @@ target("test")
     add_files("src/*.cpp")
 ```
 
-Among them, `mode.release` is the default compilation mode rule, which will automatically add some common optimization compilation options for the target build, such as: `-O2` and so on.
+Among them, `mode.release` is the default compilation mode rule, which will automatically add some common optimization compilation options for the target build, such as: `-O2`, and so on.
 
-We can also switch to `mode.debug` debugging mode through `xmake f -m debug`, and automatically configure some debugging options, such as: `-g` and so on.
+We can also switch to `mode.debug` debugging mode through `xmake f -m debug`, which will automatically configure some debugging options, such as: `-g`, and so on.
 
-Of course, we can also configure them completely by ourselves without configuring the mode rules.
+Of course, we can also configure them completely by ourselves without using the mode rules.
 
 ```lua [xmake.lua]
 target("test")
@@ -85,7 +85,7 @@ target("bar")
 If the bar target is in the `bar/xmake.lua` sub-configuration file, it will also be effective.
 
 ::: tip NOTE
-However, the root scope configuration in the sub-file cannot affect the target in the same level, parent configuration file.
+However, the root scope configuration in the sub-file cannot affect the target in the same level or parent configuration file.
 :::
 
 ```lua [xmake.lua]
@@ -108,13 +108,13 @@ target("zoo")
     add_files("src/*.cpp")
 ```
 
-Here, although `add_defines` is configured to the root scope, it only affects the bar and zoo targets, and cannot affect the foo target.
+Here, although `add_defines` is configured in the root scope, it only affects the bar and zoo targets, and cannot affect the foo target.
 
 In other words, the scope of influence of the root scope is in a tree structure, and it takes effect layer by layer.
 
 ## Configure optimization options {#configure-optimization}
 
-`mode.release` will automatically introduce some optimization options, and we can also configure it ourselves through the [set_optimize](/api/description/project-target#set-optimize) interface.
+`mode.release` will automatically introduce some optimization options, and we can also configure them ourselves through the [set_optimize](/api/description/project-target#set-optimize) interface.
 
 For example:
 
@@ -137,7 +137,7 @@ For more details, please refer to the document: [set_optimize](/api/description/
 add_includedirs("/tmp")
 ```
 
-It will add the `-I/tmp` compilation option to the compiler.
+It will add the `-I/tmp` compilation option to the compiler's command line.
 
 For more details, please refer to the document: [add_includedirs](/api/description/project-target#add-includedirs).
 
@@ -147,7 +147,7 @@ For more details, please refer to the document: [add_includedirs](/api/descripti
 add_linkdirs("/tmp")
 ```
 
-It will add the `-L/tmp` link option to the linker.
+It will add the `-L/tmp` link option to the linker command line.
 
 For more details, please refer to the document: [add_linkdirs](/api/description/project-target#add-linkdirs).
 
@@ -157,7 +157,7 @@ For more details, please refer to the document: [add_linkdirs](/api/description/
 add_links("foo")
 ```
 
-It will add the `-lfoo` link option to the linker, which usually needs to be used with [add_linkdirs](/api/description/project-target#add-linkdirs).
+It will add the `-lfoo` link option to the linker command line, which usually needs to be used with [add_linkdirs](/api/description/project-target#add-linkdirs).
 
 ```lua
 add_links("foo")
@@ -170,7 +170,7 @@ For more details, please refer to the document: [add_links](/api/description/pro
 
 `add_links` is usually used to link user-generated libraries, while `add_syslinks` can add system libraries without the need for an additional `add_linkdirs`.
 
-And its link order is relatively late.
+And its link order is relatively late (after user libraries).
 
 ```lua
 add_links("foo")
@@ -193,8 +193,7 @@ However, we can also add specific compilation options for C++ code through the `
 add_cxflags("-DDEBUG")
 ```
 
-It is equivalent to `add_defines("DEBUG")`, but `add_defines` is more general and applicable to all compilers,
-while `add_cxxflags("-DDEBUG")` may only be applicable to a few compilers, because not all compilers define macros through `-D`.
+It is equivalent to `add_defines("DEBUG")`, but `add_defines` is more general and applicable to all compilers, while `add_cxxflags("-DDEBUG")` may only be applicable to a few compilers, because not all compilers define macros through `-D`.
 
 In addition, we can also add compilation options for C code through the `add_cflags` interface, and `add_cxflags` to add compilation options for C/C++ code at the same time.
 

+ 1 - 1
docs/guide/project-configuration/define-options.md

@@ -15,7 +15,7 @@ target("foo")
     end
 ```
 
-Then, we can enable this custom option in the command line, so that the macro definition of `-DTEST` is automatically added when the foo target is compiled.
+Then, we can enable this custom option in the command line, so that the macro definition of `-DTESTS` is automatically added when the foo target is compiled.
 
 ```lua
 $ xmake f --tests=y

+ 14 - 14
docs/guide/project-configuration/multi-level-directories.md

@@ -5,13 +5,13 @@ and in the description field we can introduce the project subdirectory through t
 
 Remember: Xmake's includes handles the configuration relationship according to the tree structure. The target configuration in `xmake.lua` in the subdirectory inherits the root domain configuration in the parent `xmake.lua`, for example:
 
-Currently there are the following project structures:
+Currently, there is the following project structure:
 
 ```
 Projectdir
-    - xmake.lua
-    - src
-      - xmake.lua
+    - xmake.lua
+    - src
+      - xmake.lua
 ```
 
 `projectdir/xmake.lua` is the project's root `xmake.lua` configuration, and `src/xmake.lua` is a sub-configuration of the project.
@@ -22,14 +22,14 @@ Projectdir
 add_defines("ROOT")
 
 target("test1")
-    set_kind("binary")
-    add_files("src/*.c")
-    add_defines("TEST1")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST1")
 
 target("test2")
-    set_kind("binary")
-    add_files("src/*.c")
-    add_defines("TEST2")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST2")
 
 Includes("src")
 ```
@@ -44,12 +44,12 @@ The `add_defines("TEST1")` and `add_defines("TEST2")` in test1/test2 belong to t
 add_defines("ROOT2")
 
 target("test3")
-    set_kind("binary")
-    add_files("src/*.c")
-    add_defines("TEST3")
+    set_kind("binary")
+    add_files("src/*.c")
+    add_defines("TEST3")
 ```
 
-In the `src/xmake.lua` sub-configuration, there is also a global root domain, configured with `add_defines("ROOT2")`, which belongs to the sub-configuration root domain and only takes effect on all targets in the current `sub-xmake.lua`. For the target `xmake.lua` in the lower level includes the target, because previously said, Xmake is the configuration inheritance relationship of the tree structure.
+In the `src/xmake.lua` sub-configuration, there is also a global root domain, configured with `add_defines("ROOT2")`, which belongs to the sub-configuration root domain and only takes effect on all targets in the current `sub-xmake.lua`. For the target `xmake.lua` in the lower level includes the target, because as previously said, Xmake is the configuration inheritance relationship of the tree structure.
 
 Therefore, the final configuration results of these targets are:
 

+ 24 - 43
docs/guide/project-configuration/syntax-description.md

@@ -1,8 +1,8 @@
 # Syntax description
 
-Xmake's project description file `xmake.lua` is based on the lua syntax, but in order to make the project build logic more convenient and concise, Xmake encapsulates it, making writing `xmake.lua` not as cumbersome as some makefiles.
+Xmake's project description file `xmake.lua` is based on the Lua syntax, but in order to make the project build logic more convenient and concise, Xmake encapsulates it, making writing `xmake.lua` not as cumbersome as some makefiles.
 
-Basically write a simple project build description, just three lines, for example:
+Basically, to write a simple project build description, just three lines, for example:
 
 ```lua
 target("test")
@@ -14,16 +14,16 @@ target("test")
 
 Xmake.lua uses the 80:20 rule (aka [Pareto principle](https://en.wikipedia.org/wiki/Pareto_principle)) to implement a two-layer separate configuration of the description domain and the script domain.
 
-What is the 80:20 rule? In short, most of the project configuration, 80% of the cases, are basic basic configurations, such as: `add_cxflags`, `add_links`, etc.
+What is the 80:20 rule? In short, most of the project configuration, 80% of the cases, are basic configurations, such as: `add_cxflags`, `add_links`, etc.
 Only less than 20% of the space needs to be extra complex to meet some special configuration needs.
 
-The remaining 20% of the configuration is usually more complicated. if it is directly flooded in the whole `xmake.lua`, the whole project configuration will be very confusing and very unreadable.
+The remaining 20% of the configuration is usually more complicated. If it is directly flooded in the whole `xmake.lua`, the whole project configuration will be very confusing and very unreadable.
 
-Therefore, Xmake isolates 80% of simple configuration and 20% of complex configuration by describing two different configurations of domain and script domain, making the whole `xmake.lua` look very clear and intuitive, readable and maintainable. Get the best.
+Therefore, Xmake isolates 80% of simple configuration and 20% of complex configuration by describing two different configurations: description domain and script domain, making the whole `xmake.lua` look very clear and intuitive, readable and maintainable. Get the best results.
 
 ### Description Scope
 
-For beginners who are just getting started, or just to maintain some simple small projects, the requirements are fully met by describing the configuration completely. What is the description domain? It looks like this:
+For beginners who are just getting started, or just want to maintain some simple small projects, the requirements are fully met by describing the configuration completely. What is the description domain? It looks like this:
 
 ```lua
 target("test")
@@ -33,9 +33,9 @@ target("test")
     add_syslinks("pthread")
 ```
 
-At first glance, it is actually a configuration set of `set_xxx`/`add_xxx`. for the novice, you can not use it as a lua script, just as an ordinary, but there are some basic rules configuration files.
+At first glance, it is actually a configuration set of `set_xxx`/`add_xxx`. For the novice, you can use it not as a Lua script, but just as an ordinary, but there are some basic rules configuration file.
 
-if, by looking, there are parentheses, or function calls like scripting languages, then we can also write this (whether with parentheses to see personal preferences):
+If, by looking, there are parentheses, or function calls like scripting languages, then we can also write this (whether with parentheses is up to personal preference):
 
 ```lua
 target "test"
@@ -45,13 +45,13 @@ target "test"
     add_syslinks "pthread"
 ```
 
-Is this looking more like a profile? In fact, the description field is a configuration file, similar to the configuration of keys/values such as json, so even if you are not a newcomer to lua, you can quickly get started.
+Is this looking more like a profile? In fact, the description field is a configuration file, similar to the configuration of keys/values such as JSON, so even if you are not familiar with Lua, you can quickly get started.
 
-Moreover, for the usual projects, only the various settings of the project are configured by `set_xxx/add_xxx`, which has fully met the requirements.
+Moreover, for most projects, only the various settings of the project are configured by `set_xxx/add_xxx`, which has fully met the requirements.
 
 This is what I said at the beginning: 80% of the time, you can use the simplest configuration rules to simplify the configuration of the project, improve readability and maintainability, so that users and developers will be very friendly and more intuitive.
 
-What if we want to make some conditional judgments for different platforms and architectures? It doesn't matter, the description field is in addition to the basic configuration, it also supports conditional judgment, as well as the for loop:
+What if we want to make some conditional judgments for different platforms and architectures? It doesn't matter, the description field, in addition to the basic configuration, also supports conditional judgment, as well as the for loop:
 
 ```lua
 target("test")
@@ -73,24 +73,20 @@ target("test")
     end
 ```
 
-Is this looking a bit like lua? Although, it can usually be regarded as a common configuration problem, but Xmake is based on lua after all, so the description domain still supports the basic language features of lua.
+Is this looking a bit like Lua? Although, it can usually be regarded as a common configuration problem, but Xmake is based on Lua after all, so the description domain still supports the basic language features of Lua.
 
-::: tip NOTE
-However, it should be noted that although the description field supports lua script syntax, try not to write too complicated lua scripts in the description field, such as some time-consuming function calls and for loops.
-:::
+However, it should be noted that although the description field supports Lua script syntax, try not to write too complicated Lua scripts in the description field, such as some time-consuming function calls and for loops.
 
-And in the description field, the main purpose is to set the configuration item, so Xmake does not completely open all module interfaces, many interfaces are forbidden to be called in the description field.
+And in the description field, the main purpose is to set the configuration item, so Xmake does not completely open all module interfaces. Many interfaces are forbidden to be called in the description field.
 Even open callable interfaces are completely read-only, and time-consuming security interfaces such as `os.getenv()` read some general system information for configuration logic control.
 
-::: tip NOTE
 Also note that `xmake.lua` is parsed multiple times to resolve different configuration fields at different stages: for example: `option()`, `target()`, etc.
-:::
 
-So, don't think about writing complex lua scripts in the description field of `xmake.lua`, and don't call print in the description field to display the information, because it will be executed multiple times, remember: it will be executed multiple times! ! !
+So, don't think about writing complex Lua scripts in the description field of `xmake.lua`, and don't call print in the description field to display the information, because it will be executed multiple times, remember: it will be executed multiple times! ! !
 
 ### Script Scope
 
-Restrict the description field to write complex lua, all kinds of lua modules and interfaces are not used? How to do? This time is the time for the script domain to appear. If the user is already fully familiar with Xmake's description domain configuration and feels that some of the special configuration maintenance on the project is not met, then we can do more complex configuration logic in the script domain:
+Restrict the description field to write complex Lua, all kinds of Lua modules and interfaces are not used? How to do? This time is the time for the script domain to appear. If the user is already fully familiar with Xmake's description domain configuration and feels that some of the special configuration maintenance on the project is not met, then we can do more complex configuration logic in the script domain:
 
 ```lua
 target("test")
@@ -111,11 +107,11 @@ target("test")
 
 As long as it is similar: `on_xxx`, `after_xxx`, `before_xxx`, etc. The script inside the function body belongs to the script field.
 
-In the script domain, the user can do anything, Xmake provides an import interface to import various lua modules built into Xmake, and can also import user-supplied lua scripts.
+In the script domain, the user can do anything. Xmake provides an import interface to import various Lua modules built into Xmake, and can also import user-supplied Lua scripts.
 
 We can implement any function you want to implement in the script domain, even if you write a separate project.
 
-for some script fragments, it is not very bloated, such as the above built-in writing is enough, if you need to implement more complex scripts, do not want to be filled in a `xmake.lua`, you can separate the script into a separate lua file for maintenance.
+For some script fragments, if it is not very bloated, such as the above built-in writing is enough, if you need to implement more complex scripts, and do not want to be filled in a `xmake.lua`, you can separate the script into a separate Lua file for maintenance.
 
 E.g:
 
@@ -129,11 +125,11 @@ target("test")
 
 We can place the custom scripts in the corresponding directory of `xmake.lua`, and maintain them independently in `modules/test/load.lua` and `modules/test/install.lua`.
 
-In these independent lua scripts, we can also import various built-in modules and custom modules through [import](/api/scripts/builtin-modules/import), just like to write lua, java is no different. .
+In these independent Lua scripts, we can also import various built-in modules and custom modules through [import](/api/scripts/builtin-modules/import), just like writing Lua, Java is no different.
 
-for the different stages of the script's domain, `on_load` is mainly used for target loading, do some dynamic configuration, not like the description field, it will only be executed once!!!
+For the different stages of the script's domain, `on_load` is mainly used for target loading, to do some dynamic configuration. Unlike the description field, it will only be executed once!!!
 
-In other stages, there are many, such as: `on/after/before`_`build/install/package/run`, etc. See the target api manual section later, so I won’t go into details here.
+In other stages, there are many, such as: `on/after/before`_`build/install/package/run`, etc. See the target API manual section later, so I won't go into details here.
 
 ## Configuration Type
 
@@ -151,7 +147,7 @@ target("test2")
 
 In the above configuration, the target belongs to the configuration domain, and all the `set_xx`/`add_xxx` interface configurations below it belong to the configuration item, which is partially effective for this target.
 
-We can understand it as a local scope, similar to the block block in c:
+We can understand it as a local scope, similar to the block in C:
 
 ```c
 target("test1") {
@@ -166,31 +162,16 @@ target("test2") {
 ```
 
 However, in order to simplify the writing, Xmake stipulates that each newly defined target field starts, and the last configuration field ends automatically.
-Of course, if the user feels troubled, you can manually configure the leaving domain:
-
-```lua
-target("test1")
-    set_kind("binary")
-    add_files("src/*.c")
-target_end()
-
-target("test2")
-    set_kind("binary")
-    add_files("src/*.c")
-target_end()
-```
-
-### Configuration Scope
 
 Currently available configuration scopes are: `target()`, `option()`, `task()`, `package()`
 
-for a detailed description of each domain, see: [API Manual](/api/description/specification)
+For a detailed description of each domain, see: [API Manual](/api/description/specification)
 
 ### Configuration Item
 
 As long as the configuration with the words `set_xxx` and `add_xxx` is a configuration item, multiple configuration items can be set in one configuration field.
 
-for a description of the configuration items, see: [Interface Specifications](/api/description/specification)
+For a description of the configuration items, see: [Interface Specifications](/api/description/specification)
 
 ## Scope
 

+ 1 - 1
docs/guide/project-configuration/toolchain-configuration.md

@@ -5,7 +5,7 @@
 Previously, we mentioned that we can use the command line `xmake f --toolchain=[name]` to switch toolchains globally. For more information,
 see: [Command line toolchain switching](/guide/basic-commands/switch-toolchains).
 
-Although switching in the command line is fast and convenient, it can only switch globally. If there are multiple targets in the project, and we only want to switch the toolchain for one of them, we can only use [set_toolchains](/zh/api/description/project-target.html#set-toolchains) in the configuration file to configure it.
+Although switching in the command line is fast and convenient, it can only switch globally. If there are multiple targets in the project, and we only want to switch the toolchain for one of them, we can use [set_toolchains](/zh/api/description/project-target.html#set-toolchains) in the configuration file to configure it.
 
 For example:
 

+ 1 - 1
docs/guide/quick-start.md

@@ -35,7 +35,7 @@ Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicPars
 ```
 
 ::: tip NOTE
-If the ps script execution prompt fails, you can try to execute in administrator mode.
+If the ps script execution prompt fails, you can try to execute it in administrator mode.
 :::
 
 ### Windows