aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-06-23 22:59:00 +0800
committerruki <waruqi@gmail.com>2019-06-23 22:59:00 +0800
commit2863e153c4410ebc92cb557c0ea228ea3135280d (patch)
tree5271035d3c3a9138bfe2a1a12a4e3a3f4ce9d453
parent49a742c10a9591a160f50851ebf225f2469c4c45 (diff)
downloadxmake-docs-2863e153c4410ebc92cb557c0ea228ea3135280d.tar.gz
xmake-docs-2863e153c4410ebc92cb557c0ea228ea3135280d.zip
fix links
-rw-r--r--manual/builtin_modules.md52
-rw-r--r--manual/extension_modules.md206
-rw-r--r--zh-cn/manual/extension_modules.md192
3 files changed, 225 insertions, 225 deletions
diff --git a/manual/builtin_modules.md b/manual/builtin_modules.md
index 7045cee5..6dcfbbc6 100644
--- a/manual/builtin_modules.md
+++ b/manual/builtin_modules.md
@@ -12,30 +12,30 @@ In order to ensure that the description field of the outer layer is as simple an
Of course, a small number of read-only built-in interfaces can still be used in the description field, as shown in the following table:
</p>
-| Interface | Description | Available Domains | Supported Versions |
-| ----------------------------------------------- | -------------------------------------------- | -------------------------- | -------- |
-| [val](#val) | Get the value of the built-in variable | Script Field | >= 2.1.5 |
-| [import](#import) | Importing Extension Blocks | Script Fields | >= 2.0.1 |
-| [inherit](#inherit) | Import and inherit base class modules | Script Domain | >= 2.0.1 |
-| [ifelse](#ifelse) | Similar ternary conditional judgment | Description field, script field | >= 2.0.1 |
-| [try-catch-finally](#try-catch-finally) | Exception Capture | Script Field | >= 2.0.1 |
-| [pairs](#pairs) | Used to Traverse the Dictionary | Description Field, Script Field | >= 2.0.1 |
-| [ipairs](#ipairs) | Used to traverse arrays | Description fields, script fields | >= 2.0.1 |
-[print](#print) | Wrap Print Terminal Log | Description Field, Script Field | >= 2.0.1 |
-| [printf](#printf) | No Line Printing Terminal Log | Script Field | >= 2.0.1 |
-[cprint](#cprint) | Wrap Color Print Terminal Log | Script Field | >= 2.0.1 |
-| [cprintf](#cprintf) | No Line Color Print Terminal Log | Script Field | >= 2.0.1 |
-| [format](#format) | Format String | Description Field, Script Field | >= 2.0.1 |
-| [vformat](#vformat) | Format string, support for built-in variable escaping | Script Domain | >= 2.0.1 |
-| [raise](#raise) | Throwing an abort program | Script Field | >= 2.0.1 |
-| [os](#os) | System Operation Module | Partial Read-Only Operation Description Field, Script Field | >= 2.0.1 |
-| [io](#io) | File Manipulation Module | Script Field | >= 2.0.1 |
-| [path](#path) | Path Manipulation Module | Description Field, Script Field |= 2.0.1 |
-| [table](#table) | Array and Dictionary Operations Module | Description Field, Script Field | >= 2.0.1 |
-| [string](#string) | String Manipulation Module | Description Field, Script Field | >= 2.0.1 |
-| [process](#process) | Process Operation Module | Script Field | >= 2.0.1 |
-| [coroutine](#coroutine) | Coroutine Operation Module | Script Field | >= 2.0.1 |
-| [find_packages](#find_packages) | Find Dependency Packages | Script Fields | >= 2.2.5 |
+| Interface | Description | Available Domains | Supported Versions |
+| ----------------------------------------------- | -------------------------------------------- | -------------------------- | -------- |
+| [val](#val) | Get the value of the built-in variable | Script Field | >= 2.1.5 |
+| [import](#import) | Importing Extension Blocks | Script Fields | >= 2.0.1 |
+| [inherit](#inherit) | Import and inherit base class modules | Script Domain | >= 2.0.1 |
+| [ifelse](#ifelse) | Similar ternary conditional judgment | Description field, script field | >= 2.0.1 |
+| [try-catch-finally](#try-catch-finally) | Exception Capture | Script Field | >= 2.0.1 |
+| [pairs](#pairs) | Used to Traverse the Dictionary | Description Field, Script Field | >= 2.0.1 |
+| [ipairs](#ipairs) | Used to traverse arrays | Description fields, script fields | >= 2.0.1 |
+| [print](#print) | Wrap Print Terminal Log | Description Field, Script Field | >= 2.0.1 |
+| [printf](#printf) | No Line Printing Terminal Log | Script Field | >= 2.0.1 |
+| [cprint](#cprint) | Wrap Color Print Terminal Log | Script Field | >= 2.0.1 |
+| [cprintf](#cprintf) | No Line Color Print Terminal Log | Script Field | >= 2.0.1 |
+| [format](#format) | Format String | Description Field, Script Field | >= 2.0.1 |
+| [vformat](#vformat) | Format string, support for built-in variable escaping | Script Domain | >= 2.0.1 |
+| [raise](#raise) | Throwing an abort program | Script Field | >= 2.0.1 |
+| [os](#os) | System Operation Module | Partial Read-Only Operation Description Field, Script Field | >= 2.0.1 |
+| [io](#io) | File Manipulation Module | Script Field | >= 2.0.1 |
+| [path](#path) | Path Manipulation Module | Description Field, Script Field | = 2.0.1 |
+| [table](#table) | Array and Dictionary Operations Module | Description Field, Script Field | >= 2.0.1 |
+| [string](#string) | String Manipulation Module | Description Field, Script Field | >= 2.0.1 |
+| [process](#process) | Process Operation Module | Script Field | >= 2.0.1 |
+| [coroutine](#coroutine) | Coroutine Operation Module | Script Field | >= 2.0.1 |
+| [find_packages](#find_packages) | Find Dependency Packages | Script Fields | >= 2.2.5 |
An example of using an interface call in a description field is as follows, generally only for conditional control:
@@ -1233,9 +1233,9 @@ Adding multiple path items by splicing. Due to the path difference of `windows/u
print(path.join("$(tmpdir)", "dir1", "dir2", "file.txt"))
```
-The above splicing on Unix is ​​equivalent to: `$(tmpdir)/dir1/dir2/file.txt`, and on Windows is equivalent to: `$(tmpdir)\\dir1\\dir2\\file.txt`
+The above splicing on Unix is equivalent to: `$(tmpdir)/dir1/dir2/file.txt`, and on Windows is equivalent to: `$(tmpdir)\\dir1\\dir2\\file.txt`
-If you find this cumbersome and not clear enough, you can use: [path.translate](path-translate) to format the conversion path string to the format supported by the current platform.
+If you find this cumbersome and not clear enough, you can use: [path.translate](#pathtranslate) to format the conversion path string to the format supported by the current platform.
#### path.translate
diff --git a/manual/extension_modules.md b/manual/extension_modules.md
index eb4c1829..c51de69c 100644
--- a/manual/extension_modules.md
+++ b/manual/extension_modules.md
@@ -1,25 +1,25 @@
-All expansion modules need to be imported through the [import](#import) interface.
+All expansion modules need to be imported through the [import](/manual/builtin_modules?id=import) interface.
### core.base.option
Commonly used to get the value of the xmake command parameter option, often used for plugin development.
-| Interface | Description | Supported Versions |
-| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [option.get](#option-get) | Get Parameter Option Value | >= 2.0.1 |
+| Interface | Description | Supported Versions |
+| ----------------------------------------------- | -------------------------------------------- | -------- |
+| [option.get](#optionget) | Get Parameter Option Value | >= 2.0.1 |
#### option.get
- Get parameter option values
-Used to get parameter option values ​​in plugin development, for example:
+Used to get parameter option values in plugin development, for example:
```lua
--- Import option module
+-- import option module
import("core.base.option")
--- Plugin entry function
+-- plugin entry function
function main(...)
print(option.get("info"))
end
@@ -43,10 +43,10 @@ Used to get the configuration information of xmake global, that is, the value of
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [global.get](#global-get) | Get the specified configuration value | >= 2.0.1 |
-| [global.load](#global-load) | Load Configuration | >= 2.0.1 |
-| [global.directory](#global-directory) | Get Global Configuration Information Directory | >= 2.0.1 |
-| [global.dump](#global-dump) | Print out all global configuration information | >= 2.0.1 |
+| [global.get](#globalget) | Get the specified configuration value | >= 2.0.1 |
+| [global.load](#globalload) | Load Configuration | >= 2.0.1 |
+| [global.directory](#globaldirectory) | Get Global Configuration Information Directory | >= 2.0.1 |
+| [global.dump](#globaldump) | Print out all global configuration information | >= 2.0.1 |
<p class="tip">
Prior to version 2.1.5, it was `core.project.global`.
@@ -56,13 +56,13 @@ Prior to version 2.1.5, it was `core.project.global`.
- Get the specified configuration value
-Similar to [config.get](#config-get), the only difference is that this is obtained from the global configuration.
+Similar to [config.get](#configget), the only difference is that this is obtained from the global configuration.
#### global.load
- Load configuration
-Similar to [global.get](#global-get), the only difference is that this is loaded from the global configuration.
+Similar to [global.get](#globalget), the only difference is that this is loaded from the global configuration.
#### global.directory
@@ -90,7 +90,7 @@ Used for task operations, generally used to call other task tasks in custom scri
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [task.run](#task-run) | Run the specified task | >= 2.0.1 |
+| [task.run](#taskrun) | Run the specified task | >= 2.0.1 |
<p class="tip">
Prior to version 2.1.5, it was `core.project.task`.
@@ -158,11 +158,11 @@ Linker related operations, often used for plugin development.
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [linker.link](#linker-link) | Execute Link | >= 2.0.1 |
-| [linker.linkcmd](#linker-linkcmd) | Get Link Command Line | >= 2.0.1 |
-| [linker.linkargv](#linker-linkargv) | Get Link Command Line List | >= 2.1.5 |
-| [linker.linkflags](#linker-linkflags) | Get LinksOptions | >= 2.0.1 |
-| [linker.has_flags](#linker-has_flags) | Determine if the specified link option is supported | >= 2.1.5 |
+| [linker.link](#linkerlink) | Execute Link | >= 2.0.1 |
+| [linker.linkcmd](#linkerlinkcmd) | Get Link Command Line | >= 2.0.1 |
+| [linker.linkargv](#linkerlinkargv) | Get Link Command Line List | >= 2.1.5 |
+| [linker.linkflags](#linkerlinkflags) | Get LinksOptions | >= 2.0.1 |
+| [linker.has_flags](#linkerhas_flags) | Determine if the specified link option is supported | >= 2.1.5 |
#### linker.link
@@ -209,7 +209,7 @@ The above code tells the linker that the three object files a, b, c may be c, ob
- Get link command line string
-Get the command line string executed in [linker.link](#linker-link) directly, which is equivalent to:
+Get the command line string executed in [linker.link](#linkerlink) directly, which is equivalent to:
```lua
local cmdstr = linker.linkcmd("static", "cxx", {"a.o", "b.o", "c.o"}, target:targetfile(), {target = target})
@@ -227,7 +227,7 @@ local cmdstr = linker.linkcmd("static", "cxx", {"a.o", "b.o", "c.o"}, target:tar
- Get a list of link command line arguments
-A little different from [linker.linkcmd](#linker-linkcmd) is that this interface returns a list of parameters, table representation, more convenient to operate:
+A little different from [linker.linkcmd](#linkerlinkcmd) is that this interface returns a list of parameters, table representation, more convenient to operate:
```lua
local program, argv = linker.linkargv("static", "cxx", {"a.o", "b.o", "c.o"}, target:targetfile(), {target = target})
@@ -241,7 +241,7 @@ We can also run it directly by passing the return value to [os.runv](#os-runv):
- Get link options
-Get the link option string part of [linker.linkcmd](#linker-linkcmd) without shellname and object file list, and return by array, for example:
+Get the link option string part of [linker.linkcmd](#linkerlinkcmd) without shellname and object file list, and return by array, for example:
```lua
local flags = linker.linkflags("shared", "cc", {target = target})
@@ -271,13 +271,13 @@ Compiler related operations, often used for plugin development.
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [compiler.compile](#compiler-compile) | Execute Compilation | >= 2.0.1 |
-| [compiler.compcmd](#compiler-compcmd) | Get Compiler Command Line | >= 2.0.1 |
-| [compiler.compargv](#compiler-compargv) | Get Compiled Command Line List | >= 2.1.5 |
-| [compiler.compflags](#compiler-compflags) | Get Compilation Options | >= 2.0.1 |
-| [compiler.has_flags](#compiler-has_flags) | Determine if the specified compilation option is supported | >= 2.1.5 |
-| [compiler.features](#compiler-features) | Get all compiler features | >= 2.1.5 |
-| [compiler.has_features](#compiler-has_features) | Determine if the specified compilation feature is supported | >= 2.1.5 |
+| [compiler.compile](#compilercompile) | Execute Compilation | >= 2.0.1 |
+| [compiler.compcmd](#compilercompcmd) | Get Compiler Command Line | >= 2.0.1 |
+| [compiler.compargv](#compilercompargv) | Get Compiled Command Line List | >= 2.1.5 |
+| [compiler.compflags](#compilercompflags) | Get Compilation Options | >= 2.0.1 |
+| [compiler.has_flags](#compilerhas_flags) | Determine if the specified compilation option is supported | >= 2.1.5 |
+| [compiler.features](#compilerfeatures) | Get all compiler features | >= 2.1.5 |
+| [compiler.has_features](#compilerhas_features) | Determine if the specified compilation feature is supported | >= 2.1.5 |
#### compiler.compile
@@ -303,7 +303,7 @@ To simply compile a source file.
- Get the compile command line
-Get the command line string executed directly in [compiler.compile](#compiler-compile), which is equivalent to:
+Get the command line string executed directly in [compiler.compile](#compilercompile), which is equivalent to:
```lua
local cmdstr = compiler.compcmd("xxx.c", "xxx.o", {target = target})
@@ -335,7 +335,7 @@ end
- Get compiled command line list
-A little different from [compiler.compargv](#compiler-compargv) is that this interface returns a list of parameters, table representation, more convenient to operate:
+A little different from [compiler.compargv](#compilercompargv) is that this interface returns a list of parameters, table representation, more convenient to operate:
```lua
local program, argv = compiler.compargv("xxx.c", "xxx.o")
@@ -345,7 +345,7 @@ local program, argv = compiler.compargv("xxx.c", "xxx.o")
- Get compilation options
-Get the compile option string part of [compiler.compcmd](#compiler-compcmd) without shList of ellnames and files, for example:
+Get the compile option string part of [compiler.compcmd](#compilercompcmd) without shList of ellnames and files, for example:
```lua
local flags = compiler.compflags(sourcefile, {target = target})
@@ -484,7 +484,7 @@ if compiler.has_features("cxx_constexpr", {target = target, defines = "..", incl
end
```
-For specific feature names, refer to [compiler.features](#compiler-features).
+For specific feature names, refer to [compiler.features](#compilerfeatures).
### core.project.config
@@ -492,14 +492,14 @@ Used to get the configuration information when the project is compiled, that is,
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [config.get](#config-get) | Get the specified configuration value | >= 2.0.1 |
-| [config.load](#config-load) | Load Configuration | >= 2.0.1 |
-| [config.arch](#config-arch) | Get the schema configuration of the current project | >= 2.0.1 |
-| [config.plat](#config-plat) | Get the platform configuration of the current project | >= 2.0.1 |
-| [config.mode](#config-mode) | Get the compilation mode configuration of the current project | >= 2.0.1 |
-| [config.buildir](#config-buildir) | Get the output directory configuration of the current project | >= 2.0.1 |
-| [config.directory](#config-dIrectory) | Get the configuration information directory of the current project | >= 2.0.1 |
-| [config.dump](#config-dump) | Print out all configuration information for the current project | >= 2.0.1 |
+| [config.get](#configget) | Get the specified configuration value | >= 2.0.1 |
+| [config.load](#configload) | Load Configuration | >= 2.0.1 |
+| [config.arch](#configarch) | Get the schema configuration of the current project | >= 2.0.1 |
+| [config.plat](#configplat) | Get the platform configuration of the current project | >= 2.0.1 |
+| [config.mode](#configmode) | Get the compilation mode configuration of the current project | >= 2.0.1 |
+| [config.buildir](#configbuildir) | Get the output directory configuration of the current project | >= 2.0.1 |
+| [config.directory](#configdIrectory) | Get the configuration information directory of the current project | >= 2.0.1 |
+| [config.dump](#configdump) | Print out all configuration information for the current project | >= 2.0.1 |
#### config.get
@@ -523,7 +523,7 @@ target("test")
- Load configuration
-Generally used in plug-in development, the plug-in task is not like the custom script of the project, the environment needs to be initialized and loaded by itself, the default project configuration is not loaded, if you want to use [config.get](#config-get) interface to get the project Configuration, then you need to:
+Generally used in plug-in development, the plug-in task is not like the custom script of the project, the environment needs to be initialized and loaded by itself, the default project configuration is not loaded, if you want to use [config.get](#configget) interface to get the project Configuration, then you need to:
```lua
@@ -623,16 +623,16 @@ This module has been migrated to [core.base.task](#core-base-task) since version
Used to get some description information of the current project, that is, the configuration information defined in the `xmake.lua` project description file, for example: [target](#target), [option](#option), etc.
-| Interface | Description | Supported Versions |
-| ----------------------------------------------- | -------------------------------------------- | -------------------- |
-| [project.load](#project-load) | Load Project Configuration | >= 2.0.1 (2.1.5 Obsolete) |
-| [project.directory](#project-directory) | Get Project Directory | >= 2.0.1 |
-| [project.target](#project-target) | Get the specified project target object | >= 2.0.1 |
-| [project.targets](#project-targets) | Get the list of project target objects | >= 2.0.1 |
-| [project.option](#project-option) | Get the specified option object | >= 2.1.5 |
-| [project.options](#project-options) | Get all option objects for the project | >= 2.1.5 |
-| [project.name](#project-name) | Get current project name | >= 2.0.1 |
-| [project.version](#project-version) | Get current project version number | >= 2.0.1 |
+| Interface | Description | Supported Versions |
+| ----------------------------------------------- | -------------------------------------------- | -------------------- |
+| [project.load](#projectload) | Load Project Configuration | >= 2.0.1 (2.1.5 Obsolete) |
+| [project.directory](#projectdirectory) | Get Project Directory | >= 2.0.1 |
+| [project.target](#projecttarget) | Get the specified project target object | >= 2.0.1 |
+| [project.targets](#projecttargets) | Get the list of project target objects | >= 2.0.1 |
+| [project.option](#projectoption) | Get the specified option object | >= 2.1.5 |
+| [project.options](#projectoptions) | Get all option objects for the project | >= 2.1.5 |
+| [project.name](#projectname) | Get current project name | >= 2.0.1 |
+| [project.version](#projectversion) | Get current project version number | >= 2.0.1 |
#### project.load
@@ -762,14 +762,14 @@ Used to obtain information about the compiled language, generally used for the o
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [language.extensions](#language-extensions) | Get a list of code suffixes for all languages ​​| >= 2.1.1 |
-| [language.targetkinds](#language-targetkinds) | Get a list of target types for all languages ​​| >= 2.1.1 |
-| [language.sourcekinds](#language-sourcekinds) | Get a list of source file types for all languages ​​| >= 2.1.1 |
-| [language.sourceflags](#language-sourceflags) | Load source file compilation option name list for all languages ​​| >= 2.1.1 |
-| [language.load](#language-load) | Load the specified language | >= 2.1.1 |
-| [language.load_sk](#language-load_sk) | Load the specified language from the source file type | >= 2.1.1 |
-| [language.load_ex](#language-load_ex) | Load the specified language from the source file suffix | >= 2.1.1 |
-| [language.sourcekind_of](#language-sourcekind_of) | Get the source file type of the specified source file | >= 2.1.1 |
+| [language.extensions](#languageextensions) | Get a list of code suffixes for all languages ​​| >= 2.1.1 |
+| [language.targetkinds](#languagetargetkinds) | Get a list of target types for all languages ​​| >= 2.1.1 |
+| [language.sourcekinds](#languagesourcekinds) | Get a list of source file types for all languages ​​| >= 2.1.1 |
+| [language.sourceflags](#languagesourceflags) | Load source file compilation option name list for all languages ​​| >= 2.1.1 |
+| [language.load](#languageload) | Load the specified language | >= 2.1.1 |
+| [language.load_sk](#languageload_sk) | Load the specified language from the source file type | >= 2.1.1 |
+| [language.load_ex](#languageload_ex) | Load the specified language from the source file suffix | >= 2.1.1 |
+| [language.sourcekind_of](#languagesourcekind_of) | Get the source file type of the specified source file | >= 2.1.1 |
#### language.extensions
@@ -886,7 +886,7 @@ That is, from a given source file path, get the type of source file it belongs t
print(language.sourcekind_of("/xxxx/test.cpp"))
```
-The result is: `cxx`, which is the `c++` type. For the corresponding list, see: [language.sourcekinds](#language-sourcekinds)
+The result is: `cxx`, which is the `c++` type. For the corresponding list, see: [language.sourcekinds](#languagesourcekinds)
### core.platform.platform
@@ -894,7 +894,7 @@ Platform information related operations
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [platform.get](#platform-get) | Get configuration information about the specified platform | >= 2.0.1 |
+| [platform.get](#platformget) | Get configuration information about the specified platform | >= 2.0.1 |
#### platform.get
@@ -919,8 +919,8 @@ Environment-related operations, used to enter and leave the terminal environment
| Interface | Description | Supported Versions |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [environment.enter](#environment-enter) | Enter the specified environment | >= 2.0.1 |
-| [environment.leave](#environment-leave) | Leave the specified environment | >= 2.0.1 |
+| [environment.enter](#environmententer) | Enter the specified environment | >= 2.0.1 |
+| [environment.leave](#environmentleave) | Leave the specified environment | >= 2.0.1 |
The currently supported environments are:
@@ -951,7 +951,7 @@ Therefore, for the sake of versatility, the default xmake compiler will set this
- leaving the designated environment
-For specific use, see: [environment.enter](#environment-enter)
+For specific use, see: [environment.enter](#environmententer)
### lib.detect
@@ -963,25 +963,25 @@ The interface of this module is spread across multiple module directories, try t
| Interface | Description | Supported Versions |
| --------------------------------------------------- | -------------------------------------------- | -------------------- |
-| [detect.find_file](#detect-find_file) | Find Files | >= 2.1.5 |
-| [detect.find_path](#detect-find_path) | Find File Path | >= 2.1.5 |
-| [detect.find_library](#detect-find_library) | Find Library Files | >= 2.1.5 |
-| [detect.find_program](#detect-find_program) | Find executables | >= 2.1.5 |
-| [detect.find_programver](#detect-find_programver) | Find executable version number | >= 2.1.5 |
-| [detect.find_package](#detect-find_package) | Find package files, including library files and search paths | >= 2.1.5 |
-| [detect.find_tool](#detect-find_tool) | Find Tool | >= 2.1.5 |
-| [detect.find_toolname](#detect-find_toolname) | Find Tool Name | >= 2.1.5 |
-| [detect.find_cudadevices](#detect-find_cudadevices) | Find CUDA devices of the host | >= 2.2.7 |
-| [detect.features](#detect-features) | Get all the features of the specified tool | >= 2.1.5 |
-| [detect.has_features](#detect-has_features) | Determine if the specified feature is supported | >= 2.1.5 |
-| [detect.has_flags](#detect-has_flags) | Determine if the specified parameter options are supported | >= 2.1.5 |
-| [detect.has_cfuncs](#detect-has_cfuncs) | Determine if the specified c function exists | >= 2.1.5 |
-| [detect.has_cxxfuncs](#detect-has_cxxfuncs) | Determine if the specified c++ function exists | >= 2.1.5 |
-| [detect.has_cincludes](#detect-has_cincludes) | Determine if the specified c header file exists | >= 2.1.5 |
-| [detect.has_cxxincludess](#detect-has_cxxincludes) | Determine if the specified c++ header file exists | >= 2.1.5 |
-| [detect.has_ctypes](#detect-has_ctypes) | Determine if the specified c type exists | >= 2.1.5 |
-| [detect.has_cxxtypes](#detect-has_cxxtypes) | Determine if the specified c++ type exists | >= 2.1.5 |
-| [detect.check_cxsnippets](#detect-check_cxsnippets) | Check if c/c++ code snippets can be compiled by | >= 2.1.5 |
+| [detect.find_file](#detectfind_file) | Find Files | >= 2.1.5 |
+| [detect.find_path](#detectfind_path) | Find File Path | >= 2.1.5 |
+| [detect.find_library](#detectfind_library) | Find Library Files | >= 2.1.5 |
+| [detect.find_program](#detectfind_program) | Find executables | >= 2.1.5 |
+| [detect.find_programver](#detectfind_programver) | Find executable version number | >= 2.1.5 |
+| [detect.find_package](#detectfind_package) | Find package files, including library files and search paths | >= 2.1.5 |
+| [detect.find_tool](#detectfind_tool) | Find Tool | >= 2.1.5 |
+| [detect.find_toolname](#detectfind_toolname) | Find Tool Name | >= 2.1.5 |
+| [detect.find_cudadevices](#detectfind_cudadevices) | Find CUDA devices of the host | >= 2.2.7 |
+| [detect.features](#detectfeatures) | Get all the features of the specified tool | >= 2.1.5 |
+| [detect.has_features](#detecthas_features) | Determine if the specified feature is supported | >= 2.1.5 |
+| [detect.has_flags](#detecthas_flags) | Determine if the specified parameter options are supported | >= 2.1.5 |
+| [detect.has_cfuncs](#detecthas_cfuncs) | Determine if the specified c function exists | >= 2.1.5 |
+| [detect.has_cxxfuncs](#detecthas_cxxfuncs) | Determine if the specified c++ function exists | >= 2.1.5 |
+| [detect.has_cincludes](#detecthas_cincludes) | Determine if the specified c header file exists | >= 2.1.5 |
+| [detect.has_cxxincludess](#detecthas_cxxincludes) | Determine if the specified c++ header file exists | >= 2.1.5 |
+| [detect.has_ctypes](#detecthas_ctypes) | Determine if the specified c type exists | >= 2.1.5 |
+| [detect.has_cxxtypes](#detecthas_cxxtypes) | Determine if the specified c++ type exists | >= 2.1.5 |
+| [detect.check_cxsnippets](#detectcheck_cxsnippets) | Check if c/c++ code snippets can be compiled by | >= 2.1.5 |
#### detect.find_file
@@ -1042,7 +1042,7 @@ We can also quickly call and test this interface with the `xmake lua` plugin: `x
- Find the path
-The usage of this interface is similar to [lib.detect.find_file](#detect-find_file), the only difference is that the returned results are different.
+The usage of this interface is similar to [lib.detect.find_file](#detectfind_file), the only difference is that the returned results are different.
After the interface finds the incoming file path, it returns the corresponding search path, not the file path itself. It is generally used to find the parent directory location corresponding to the file.
```lua
@@ -1106,7 +1106,7 @@ local library = find_library("cryp*", {"/usr", "/usr/local"}, {suffixes = "/lib"
- Find executable programs
-This interface is more primitive than [lib.detect.find_tool](#detect-find_tool), looking for executables through the specified parameter directory.
+This interface is more primitive than [lib.detect.find_tool](#detectfind_tool), looking for executables through the specified parameter directory.
```lua
import("lib.detect.find_program")
@@ -1186,7 +1186,7 @@ We can also test quickly with `xmake lua lib.detect.find_programver ccache`.
- Find package files
-This interface is also used to find library files, but it is higher than [lib.detect.find_library](#detect-find_library), and it is more powerful and easy to use, because it is based on the strength of the package.
+This interface is also used to find library files, but it is higher than [lib.detect.find_library](#detectfind_library), and it is more powerful and easy to use, because it is based on the strength of the package.
So what is a complete package, it contains:
@@ -1360,7 +1360,7 @@ function main(opt)
Inside the windows platform to read the registry, to find the
specified library file, the bottom layer is actually called
-[find_library](#detect-find_library) and other interfaces.
+[find_library](#detectfind_library) and other interfaces.
<p class="tip"> In order to speed up the efficiency of frequent
lookups, this interface is self-contained by default. If you want to
@@ -1394,7 +1394,7 @@ adding the `vcpkg::`, `conan::` package namespace.
- Find tool
This interface is also used to find executable programs, but more
-advanced than [lib.detect.find_program](#detect-find_program), the
+advanced than [lib.detect.find_program](#detectfind_program), the
function is also more powerful, it encapsulates the executable
program, providing the concept of tools:
@@ -1410,7 +1410,7 @@ The corresponding relationship is as follows:
| gcc | `/usr/toolchains/bin/arm-linux-gcc` |
| link | `link.exe -lib` |
-[lib.detect.find_program](#detect-find_program) can only determine
+[lib.detect.find_program](#detectfind_program) can only determine
whether the program exists by passing in the original program command
or path. And `find_tool` can find the tool through a more consistent
toolname, and return the corresponding program complete command path,
@@ -1558,7 +1558,7 @@ Please refer to [CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/cuda-r
- Get all the features of the specified tool
-This interface is similar to [compiler.features](#compiler-features). The difference is that this interface is more primitive. The passed argument is the actual tool name toolname.
+This interface is similar to [compiler.features](#compilerfeatures). The difference is that this interface is more primitive. The passed argument is the actual tool name toolname.
And this interface not only can get the characteristics of the compiler, the characteristics of any tool can be obtained, so it is more versatile.
@@ -1572,13 +1572,13 @@ local features = features("clang", {flags = {"-g", "-O0", "-std=c++11"}})
By passing in flags, you can change the result of the feature, for example, some features of C++11, which are not available by default. After enabling `-std=c++11`, you can get it.
-A list of all compiler features can be found at [compiler.features](#compiler-features).
+A list of all compiler features can be found at [compiler.features](#compilerfeatures).
#### detect.has_features
- Determine if the specified feature is supported
-This interface is similar to [compiler.has_features](#compiler-has_features), but more primitive, the passed argument is the actual tool name toolname.
+This interface is similar to [compiler.has_features](#compilerhas_features), but more primitive, the passed argument is the actual tool name toolname.
And this interface can not only judge the characteristics of the compiler, but the characteristics of any tool can be judged, so it is more versatile.
@@ -1592,13 +1592,13 @@ local features = has_features("clang", {"cxx_constexpr", "c_static_assert"}, {fl
If the specified feature list exists, the actual supported feature sublist is returned. If none is supported, nil is returned. We can also change the feature acquisition rule by specifying flags.
-A list of all compiler features can be found at [compiler.features](#compiler-features).
+A list of all compiler features can be found at [compiler.features](#compilerfeatures).
#### detect.has_flags
- Determine if the specified parameter option is supported
-This interface is similar to [compiler.has_flags](#compiler-has_flags), but more primitive, the passed argument is the actual tool name toolname.
+This interface is similar to [compiler.has_flags](#compilerhas_flags), but more primitive, the passed argument is the actual tool name toolname.
```lua
import("lib.detect.has_flags")
@@ -1616,7 +1616,7 @@ The detection of this interface has been optimized. Except for the cache mechani
- Determine if the specified c function exists
-This interface is a simplified version of [lib.detect.check_cxsnippets](#detect-check_cxsnippets) and is only used to detect functions.
+This interface is a simplified version of [lib.detect.check_cxsnippets](#detectcheck_cxsnippets) and is only used to detect functions.
```lua
import("lib.detect.has_cfuncs")
@@ -1645,13 +1645,13 @@ The verbose is used to echo the detection information, the target is used to app
- Determine if the specified c++ function exists
-This interface is similar to [lib.detect.has_cfuncs](#detect-has_cfuncs), please refer to its instructions for use. The only difference is that this interface is used to detect c++ functions.
+This interface is similar to [lib.detect.has_cfuncs](#detecthas_cfuncs), please refer to its instructions for use. The only difference is that this interface is used to detect c++ functions.
#### detect.has_cincludes
- Determine if the specified c header file exists
-This interface is a simplified version of [lib.detect.check_cxsnippets](#detect-check_cxsnippets) and is only used to detect header files.
+This interface is a simplified version of [lib.detect.check_cxsnippets](#detectcheck_cxsnippets) and is only used to detect header files.
```lua
import("lib.detect.has_cincludes")
@@ -1665,13 +1665,13 @@ local ok = has_cincludes({"stdio.h", "stdlib.h"}, {config = {defines = "_GNU_SOU
- Determine if the specified c++ header file exists
-This interface is similar to [lib.detect.has_cincludess](#detect-has_cincludes), please refer to its instructions for use. The only difference is that this interface is used to detect c++ header files.
+This interface is similar to [lib.detect.has_cincludess](#detecthas_cincludes), please refer to its instructions for use. The only difference is that this interface is used to detect c++ header files.
#### detect.has_ctypes
- Determine if the specified c type exists
-This interface is a simplified version of [lib.detect.check_cxsnippets](#detect-check_cxsnippets) and is only used to detect functions.
+This interface is a simplified version of [lib.detect.check_cxsnippets](#detectcheck_cxsnippets) and is only used to detect functions.
```lua
import("lib.detect.has_ctypes")
@@ -1685,7 +1685,7 @@ local ok = has_ctypes("wchar_t", {includes = {"stdio.h", "stdlib.h"}, config = {
- Determine if the specified c++ type exists
-This interface is similar to [lib.detect.has_ctypess](#detect-has_ctypes). Please refer to its instructions for use. The only difference is that this interface is used to detect c++ types.
+This interface is similar to [lib.detect.has_ctypess](#detecthas_ctypes). Please refer to its instructions for use. The only difference is that this interface is used to detect c++ types.
#### detect.check_cxsnippets
@@ -1693,7 +1693,7 @@ This interface is similar to [lib.detect.has_ctypess](#detect-has_ctypes). Pleas
The generic c/c++ code snippet detection interface, by passing in a list of multiple code snippets, it will automatically generate a compiled file, and then common sense to compile it, if the compilation pass returns true.
-For some complex compiler features, even if [compiler.has_features](#compiler-has_features) can't detect it, you can detect it by trying to compile through this interface.
+For some complex compiler features, even if [compiler.has_features](#compilerhas_features) can't detect it, you can detect it by trying to compile through this interface.
```lua
import("lib.detect.check_cxsnippets")
@@ -1702,7 +1702,7 @@ local ok = check_cxsnippets("void test() {}")
local ok = check_cxsnippets({"void test(){}", "#define TEST 1"}, {types = "wchar_t", includes = "stdio.h"})
```
-This interface is a generic version of interfaces such as [detect.has_cfuncs](#detect-has_cfuncs), [detect.has_cincludes](#detect-has_cincludes), and [detect.has_ctypes](detect-has_ctypes), and is also lower level.
+This interface is a generic version of interfaces such as [detect.has_cfuncs](#detecthas_cfuncs), [detect.has_cincludes](#detecthas_cincludes), and [detect.has_ctypes](detect-has_ctypes), and is also lower level.
So we can use it to detect: types, functions, includes and links, or combine them together to detect.
diff --git a/zh-cn/manual/extension_modules.md b/zh-cn/manual/extension_modules.md
index bb636239..a58bd741 100644
--- a/zh-cn/manual/extension_modules.md
+++ b/zh-cn/manual/extension_modules.md
@@ -1,5 +1,5 @@
-所有扩展模块的使用,都需要通过[import](#import)接口,进行导入后才能使用。
+所有扩展模块的使用,都需要通过[import](/zh-cn/manual/builtin_modules?id=import)接口,进行导入后才能使用。
### core.base.option
@@ -7,7 +7,7 @@
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [option.get](#option-get) | 获取参数选项值 | >= 2.0.1 |
+| [option.get](#optionget) | 获取参数选项值 | >= 2.0.1 |
#### option.get
@@ -43,10 +43,10 @@ task("hello")
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [global.get](#global-get) | 获取指定配置值 | >= 2.0.1 |
-| [global.load](#global-load) | 加载配置 | >= 2.0.1 |
-| [global.directory](#global-directory) | 获取全局配置信息目录 | >= 2.0.1 |
-| [global.dump](#global-dump) | 打印输出所有全局配置信息 | >= 2.0.1 |
+| [global.get](#globalget) | 获取指定配置值 | >= 2.0.1 |
+| [global.load](#globalload) | 加载配置 | >= 2.0.1 |
+| [global.directory](#globaldirectory) | 获取全局配置信息目录 | >= 2.0.1 |
+| [global.dump](#globaldump) | 打印输出所有全局配置信息 | >= 2.0.1 |
<p class="tip">
2.1.5版本之前为`core.project.global`。
@@ -56,13 +56,13 @@ task("hello")
- 获取指定配置值
-类似[config.get](#config-get),唯一的区别就是这个是从全局配置中获取。
+类似[config.get](#configget),唯一的区别就是这个是从全局配置中获取。
#### global.load
- 加载配置
-类似[global.get](#global-get),唯一的区别就是这个是从全局配置中加载。
+类似[global.get](#globalget),唯一的区别就是这个是从全局配置中加载。
#### global.directory
@@ -90,7 +90,7 @@ task("hello")
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [task.run](#task-run) | 运行指定任务 | >= 2.0.1 |
+| [task.run](#taskrun) | 运行指定任务 | >= 2.0.1 |
<p class="tip">
2.1.5版本之前为`core.project.task`。
@@ -158,11 +158,11 @@ emd
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [linker.link](#linker-link) | 执行链接 | >= 2.0.1 |
-| [linker.linkcmd](#linker-linkcmd) | 获取链接命令行 | >= 2.0.1 |
-| [linker.linkargv](#linker-linkargv) | 获取链接命令行列表 | >= 2.1.5 |
-| [linker.linkflags](#linker-linkflags) | 获取链接选项 | >= 2.0.1 |
-| [linker.has_flags](#linker-has_flags) | 判断指定链接选项是否支持 | >= 2.1.5 |
+| [linker.link](#linkerlink) | 执行链接 | >= 2.0.1 |
+| [linker.linkcmd](#linkerlinkcmd) | 获取链接命令行 | >= 2.0.1 |
+| [linker.linkargv](#linkerlinkargv) | 获取链接命令行列表 | >= 2.1.5 |
+| [linker.linkflags](#linkerlinkflags) | 获取链接选项 | >= 2.0.1 |
+| [linker.has_flags](#linkerhas_flags) | 判断指定链接选项是否支持 | >= 2.1.5 |
#### linker.link
@@ -209,7 +209,7 @@ linker.link("binary", {"cc", "mxx", "sc"}, {"a.o", "b.o", "c.o"}, "/tmp/targetfi
- 获取链接命令行字符串
-直接获取[linker.link](#linker-link)中执行的命令行字符串,相当于:
+直接获取[linker.link](#linkerlink)中执行的命令行字符串,相当于:
```lua
local cmdstr = linker.linkcmd("static", "cxx", {"a.o", "b.o", "c.o"}, target:targetfile(), {target = target})
@@ -227,7 +227,7 @@ local cmdstr = linker.linkcmd("static", "cxx", {"a.o", "b.o", "c.o"}, target:tar
- 获取链接命令行参数列表
-跟[linker.linkcmd](#linker-linkcmd)稍微有点区别的是,此接口返回的是参数列表,table表示,更加方便操作:
+跟[linker.linkcmd](#linkerlinkcmd)稍微有点区别的是,此接口返回的是参数列表,table表示,更加方便操作:
```lua
local program, argv = linker.linkargv("static", "cxx", {"a.o", "b.o", "c.o"}, target:targetfile(), {target = target})
@@ -241,7 +241,7 @@ local program, argv = linker.linkargv("static", "cxx", {"a.o", "b.o", "c.o"}, ta
- 获取链接选项
-获取[linker.linkcmd](#linker-linkcmd)中的链接选项字符串部分,不带shellname和对象文件列表,并且是按数组返回,例如:
+获取[linker.linkcmd](#linkerlinkcmd)中的链接选项字符串部分,不带shellname和对象文件列表,并且是按数组返回,例如:
```lua
local flags = linker.linkflags("shared", "cc", {target = target})
@@ -271,13 +271,13 @@ end
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [compiler.compile](#compiler-compile) | 执行编译 | >= 2.0.1 |
-| [compiler.compcmd](#compiler-compcmd) | 获取编译命令行 | >= 2.0.1 |
-| [compiler.compargv](#compiler-compargv) | 获取编译命令行列表 | >= 2.1.5 |
-| [compiler.compflags](#compiler-compflags) | 获取编译选项 | >= 2.0.1 |
-| [compiler.has_flags](#compiler-has_flags) | 判断指定编译选项是否支持 | >= 2.1.5 |
-| [compiler.features](#compiler-features) | 获取所有编译器特性 | >= 2.1.5 |
-| [compiler.has_features](#compiler-has_features) | 判断指定编译特性是否支持 | >= 2.1.5 |
+| [compiler.compile](#compilercompile) | 执行编译 | >= 2.0.1 |
+| [compiler.compcmd](#compilercompcmd) | 获取编译命令行 | >= 2.0.1 |
+| [compiler.compargv](#compilercompargv) | 获取编译命令行列表 | >= 2.1.5 |
+| [compiler.compflags](#compilercompflags) | 获取编译选项 | >= 2.0.1 |
+| [compiler.has_flags](#compilerhas_flags) | 判断指定编译选项是否支持 | >= 2.1.5 |
+| [compiler.features](#compilerfeatures) | 获取所有编译器特性 | >= 2.1.5 |
+| [compiler.has_features](#compilerhas_features) | 判断指定编译特性是否支持 | >= 2.1.5 |
#### compiler.compile
@@ -303,7 +303,7 @@ compiler.compile("xxx.c", "xxx.o")
- 获取编译命令行
-直接获取[compiler.compile](#compiler-compile)中执行的命令行字符串,相当于:
+直接获取[compiler.compile](#compilercompile)中执行的命令行字符串,相当于:
```lua
local cmdstr = compiler.compcmd("xxx.c", "xxx.o", {target = target})
@@ -335,7 +335,7 @@ end
- 获取编译命令行列表
-跟[compiler.compargv](#compiler-compargv)稍微有点区别的是,此接口返回的是参数列表,table表示,更加方便操作:
+跟[compiler.compargv](#compilercompargv)稍微有点区别的是,此接口返回的是参数列表,table表示,更加方便操作:
```lua
local program, argv = compiler.compargv("xxx.c", "xxx.o")
@@ -345,7 +345,7 @@ local program, argv = compiler.compargv("xxx.c", "xxx.o")
- 获取编译选项
-获取[compiler.compcmd](#compiler-compcmd)中的编译选项字符串部分,不带shellname和文件列表,例如:
+获取[compiler.compcmd](#compilercompcmd)中的编译选项字符串部分,不带shellname和文件列表,例如:
```lua
local flags = compiler.compflags(sourcefile, {target = target})
@@ -484,7 +484,7 @@ if compiler.has_features("cxx_constexpr", {target = target, defines = "..", incl
end
```
-具体特性名有哪些,可以参考:[compiler.features](#compiler-features)。
+具体特性名有哪些,可以参考:[compiler.features](#compilerfeatures)。
### core.project.config
@@ -492,14 +492,14 @@ end
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [config.get](#config-get) | 获取指定配置值 | >= 2.0.1 |
-| [config.load](#config-load) | 加载配置 | >= 2.0.1 |
-| [config.arch](#config-arch) | 获取当前工程的架构配置 | >= 2.0.1 |
-| [config.plat](#config-plat) | 获取当前工程的平台配置 | >= 2.0.1 |
-| [config.mode](#config-mode) | 获取当前工程的编译模式配置 | >= 2.0.1 |
-| [config.buildir](#config-buildir) | 获取当前工程的输出目录配置 | >= 2.0.1 |
-| [config.directory](#config-directory) | 获取当前工程的配置信息目录 | >= 2.0.1 |
-| [config.dump](#config-dump) | 打印输出当前工程的所有配置信息 | >= 2.0.1 |
+| [config.get](#configget) | 获取指定配置值 | >= 2.0.1 |
+| [config.load](#configload) | 加载配置 | >= 2.0.1 |
+| [config.arch](#configarch) | 获取当前工程的架构配置 | >= 2.0.1 |
+| [config.plat](#configplat) | 获取当前工程的平台配置 | >= 2.0.1 |
+| [config.mode](#configmode) | 获取当前工程的编译模式配置 | >= 2.0.1 |
+| [config.buildir](#configbuildir) | 获取当前工程的输出目录配置 | >= 2.0.1 |
+| [config.directory](#configdirectory) | 获取当前工程的配置信息目录 | >= 2.0.1 |
+| [config.dump](#configdump) | 打印输出当前工程的所有配置信息 | >= 2.0.1 |
#### config.get
@@ -523,7 +523,7 @@ target("test")
- 加载配置
-一般用于插件开发中,插件任务中不像工程的自定义脚本,环境需要自己初始化加载,默认工程配置是没有被加载的,如果要用[config.get](#config-get)接口获取工程配置,那么需要先:
+一般用于插件开发中,插件任务中不像工程的自定义脚本,环境需要自己初始化加载,默认工程配置是没有被加载的,如果要用[config.get](#configget)接口获取工程配置,那么需要先:
```lua
@@ -625,14 +625,14 @@ end
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------------------- |
-| [project.load](#project-load) | 加载工程配置 | >= 2.0.1 (2.1.5废弃) |
-| [project.directory](#project-directory) | 获取工程目录 | >= 2.0.1 |
-| [project.target](#project-target) | 获取指定工程目标对象 | >= 2.0.1 |
-| [project.targets](#project-targets) | 获取工程目标对象列表 | >= 2.0.1 |
-| [project.option](#project-option) | 获取指定的选项对象 | >= 2.1.5 |
-| [project.options](#project-options) | 获取工程所有的选项对象 | >= 2.1.5 |
-| [project.name](#project-name) | 获取当前工程名 | >= 2.0.1 |
-| [project.version](#project-version) | 获取当前工程版本号 | >= 2.0.1 |
+| [project.load](#projectload) | 加载工程配置 | >= 2.0.1 (2.1.5废弃) |
+| [project.directory](#projectdirectory) | 获取工程目录 | >= 2.0.1 |
+| [project.target](#projecttarget) | 获取指定工程目标对象 | >= 2.0.1 |
+| [project.targets](#projecttargets) | 获取工程目标对象列表 | >= 2.0.1 |
+| [project.option](#projectoption) | 获取指定的选项对象 | >= 2.1.5 |
+| [project.options](#projectoptions) | 获取工程所有的选项对象 | >= 2.1.5 |
+| [project.name](#projectname) | 获取当前工程名 | >= 2.0.1 |
+| [project.version](#projectversion) | 获取当前工程版本号 | >= 2.0.1 |
#### project.load
@@ -768,14 +768,14 @@ print(project.version())
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [language.extensions](#language-extensions) | 获取所有语言的代码后缀名列表 | >= 2.1.1 |
-| [language.targetkinds](#language-targetkinds) | 获取所有语言的目标类型列表 | >= 2.1.1 |
-| [language.sourcekinds](#language-sourcekinds) | 获取所有语言的源文件类型列表 | >= 2.1.1 |
-| [language.sourceflags](#language-sourceflags) | 加载所有语言的源文件编译选项名列表 | >= 2.1.1 |
-| [language.load](#language-load) | 加载指定语言 | >= 2.1.1 |
-| [language.load_sk](#language-load_sk) | 从源文件类型加载指定语言 | >= 2.1.1 |
-| [language.load_ex](#language-load_ex) | 从源文件后缀名加载指定语言 | >= 2.1.1 |
-| [language.sourcekind_of](#language-sourcekind_of) | 获取指定源文件的源文件类型 | >= 2.1.1 |
+| [language.extensions](#languageextensions) | 获取所有语言的代码后缀名列表 | >= 2.1.1 |
+| [language.targetkinds](#languagetargetkinds) | 获取所有语言的目标类型列表 | >= 2.1.1 |
+| [language.sourcekinds](#languagesourcekinds) | 获取所有语言的源文件类型列表 | >= 2.1.1 |
+| [language.sourceflags](#languagesourceflags) | 加载所有语言的源文件编译选项名列表 | >= 2.1.1 |
+| [language.load](#languageload) | 加载指定语言 | >= 2.1.1 |
+| [language.load_sk](#languageload_sk) | 从源文件类型加载指定语言 | >= 2.1.1 |
+| [language.load_ex](#languageload_ex) | 从源文件后缀名加载指定语言 | >= 2.1.1 |
+| [language.sourcekind_of](#languagesourcekind_of) | 获取指定源文件的源文件类型 | >= 2.1.1 |
#### language.extensions
@@ -892,7 +892,7 @@ end
print(language.sourcekind_of("/xxxx/test.cpp"))
```
-显示结果为:`cxx`,也就是`c++`类型,具体对应列表见:[language.sourcekinds](#language-sourcekinds)
+显示结果为:`cxx`,也就是`c++`类型,具体对应列表见:[language.sourcekinds](#languagesourcekinds)
### core.platform.platform
@@ -900,7 +900,7 @@ print(language.sourcekind_of("/xxxx/test.cpp"))
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [platform.get](#platform-get) | 获取指定平台相关配置信息 | >= 2.0.1 |
+| [platform.get](#platformget) | 获取指定平台相关配置信息 | >= 2.0.1 |
#### platform.get
@@ -925,8 +925,8 @@ table.dump(formats)
| 接口 | 描述 | 支持版本 |
| ----------------------------------------------- | -------------------------------------------- | -------- |
-| [environment.enter](#environment-enter) | 进入指定环境 | >= 2.0.1 |
-| [environment.leave](#environment-leave) | 离开指定环境 | >= 2.0.1 |
+| [environment.enter](#environmententer) | 进入指定环境 | >= 2.0.1 |
+| [environment.leave](#environmentleave) | 离开指定环境 | >= 2.0.1 |
目前支持的环境有:
@@ -957,7 +957,7 @@ environment.leave("toolchains")
- 离开指定环境
-具体使用见:[environment.enter](#environment-enter)
+具体使用见:[environment.enter](#environmententer)
### lib.detect
@@ -969,25 +969,25 @@ environment.leave("toolchains")
| 接口 | 描述 | 支持版本 |
| --------------------------------------------------- | -------------------------------------------- | -------------------- |
-| [detect.find_file](#detect-find_file) | 查找文件 | >= 2.1.5 |
-| [detect.find_path](#detect-find_path) | 查找文件路径 | >= 2.1.5 |
-| [detect.find_library](#detect-find_library) | 查找库文件 | >= 2.1.5 |
-| [detect.find_program](#detect-find_program) | 查找可执行程序 | >= 2.1.5 |
-| [detect.find_programver](#detect-find_programver) | 查找可执行程序版本号 | >= 2.1.5 |
-| [detect.find_package](#detect-find_package) | 查找包文件,包含库文件和搜索路径 | >= 2.1.5 |
-| [detect.find_tool](#detect-find_tool) | 查找工具 | >= 2.1.5 |
-| [detect.find_toolname](#detect-find_toolname) | 查找工具名 | >= 2.1.5 |
-| [detect.find_cudadevices](#detect-find_cudadevices) | 查找本机的 CUDA 设备 | >= 2.2.7 |
-| [detect.features](#detect-features) | 获取指定工具的所有特性 | >= 2.1.5 |
-| [detect.has_features](#detect-has_features) | 判断指定特性是否支持 | >= 2.1.5 |
-| [detect.has_flags](#detect-has_flags) | 判断指定参数选项是否支持 | >= 2.1.5 |
-| [detect.has_cfuncs](#detect-has_cfuncs) | 判断指定c函数是否存在 | >= 2.1.5 |
-| [detect.has_cxxfuncs](#detect-has_cxxfuncs) | 判断指定c++函数是否存在 | >= 2.1.5 |
-| [detect.has_cincludes](#detect-has_cincludes) | 判断指定c头文件是否存在 | >= 2.1.5 |
-| [detect.has_cxxincludess](#detect-has_cxxincludes) | 判断指定c++头文件是否存在 | >= 2.1.5 |
-| [detect.has_ctypes](#detect-has_ctypes) | 判断指定c类型是否存在 | >= 2.1.5 |
-| [detect.has_cxxtypes](#detect-has_cxxtypes) | 判断指定c++类型是否存在 | >= 2.1.5 |
-| [detect.check_cxsnippets](#detect-check_cxsnippets) | 检测c/c++代码片段是否能够编译通过 | >= 2.1.5 |
+| [detect.find_file](#detectfind_file) | 查找文件 | >= 2.1.5 |
+| [detect.find_path](#detectfind_path) | 查找文件路径 | >= 2.1.5 |
+| [detect.find_library](#detectfind_library) | 查找库文件 | >= 2.1.5 |
+| [detect.find_program](#detectfind_program) | 查找可执行程序 | >= 2.1.5 |
+| [detect.find_programver](#detectfind_programver) | 查找可执行程序版本号 | >= 2.1.5 |
+| [detect.find_package](#detectfind_package) | 查找包文件,包含库文件和搜索路径 | >= 2.1.5 |
+| [detect.find_tool](#detectfind_tool) | 查找工具 | >= 2.1.5 |
+| [detect.find_toolname](#detectfind_toolname) | 查找工具名 | >= 2.1.5 |
+| [detect.find_cudadevices](#detectfind_cudadevices) | 查找本机的 CUDA 设备 | >= 2.2.7 |
+| [detect.features](#detectfeatures) | 获取指定工具的所有特性 | >= 2.1.5 |
+| [detect.has_features](#detecthas_features) | 判断指定特性是否支持 | >= 2.1.5 |
+| [detect.has_flags](#detecthas_flags) | 判断指定参数选项是否支持 | >= 2.1.5 |
+| [detect.has_cfuncs](#detecthas_cfuncs) | 判断指定c函数是否存在 | >= 2.1.5 |
+| [detect.has_cxxfuncs](#detecthas_cxxfuncs) | 判断指定c++函数是否存在 | >= 2.1.5 |
+| [detect.has_cincludes](#detecthas_cincludes) | 判断指定c头文件是否存在 | >= 2.1.5 |
+| [detect.has_cxxincludess](#detecthas_cxxincludes) | 判断指定c++头文件是否存在 | >= 2.1.5 |
+| [detect.has_ctypes](#detecthas_ctypes) | 判断指定c类型是否存在 | >= 2.1.5 |
+| [detect.has_cxxtypes](#detecthas_cxxtypes) | 判断指定c++类型是否存在 | >= 2.1.5 |
+| [detect.check_cxsnippets](#detectcheck_cxsnippets) | 检测c/c++代码片段是否能够编译通过 | >= 2.1.5 |
#### detect.find_file
@@ -1048,7 +1048,7 @@ local file = find_file("test.h", { "/usr", "/usr/local"}, {suffixes = {"/include
- 查找路径
-这个接口的用法跟[lib.detect.find_file](#detect-find_file)类似,唯一的区别是返回的结果不同。
+这个接口的用法跟[lib.detect.find_file](#detectfind_file)类似,唯一的区别是返回的结果不同。
此接口查找到传入的文件路径后,返回的是对应的搜索路径,而不是文件路径本身,一般用于查找文件对应的父目录位置。
```lua
@@ -1112,7 +1112,7 @@ local library = find_library("cryp*", {"/usr", "/usr/local"}, {suffixes = "/lib"
- 查找可执行程序
-这个接口比[lib.detect.find_tool](#detect-find_tool)较为原始底层,通过指定的参数目录来查找可执行程序。
+这个接口比[lib.detect.find_tool](#detectfind_tool)较为原始底层,通过指定的参数目录来查找可执行程序。
```lua
import("lib.detect.find_program")
@@ -1192,7 +1192,7 @@ local version = find_programver("ccache", {command = "--version", parse = functi
- 查找包文件
-此接口也是用于查找库文件,但是比[lib.detect.find_library](#detect-find_library)更加上层,也更为强大和简单易用,因为它是以包为力度进行查找。
+此接口也是用于查找库文件,但是比[lib.detect.find_library](#detectfind_library)更加上层,也更为强大和简单易用,因为它是以包为力度进行查找。
那怎样算是一个完整的包,它包含:
@@ -1364,7 +1364,7 @@ function main(opt)
end
```
-里面对windows平台进行注册表读取,去查找指定的库文件,其底层其实也是调用的[find_library](#detect-find_library)等接口。
+里面对windows平台进行注册表读取,去查找指定的库文件,其底层其实也是调用的[find_library](#detectfind_library)等接口。
<p class="tip">
为了加速频发查找的效率,此接口是默认自带cache的,如果要禁用cache,可以在工程目录执行`xmake f -c`清除本地cache。
@@ -1389,7 +1389,7 @@ find_package("brew::pcre2/libpcre2-8")
- 查找工具
-此接口也是用于查找可执行程序,不过比[lib.detect.find_program](#detect-find_program)更加的高级,功能也更加强大,它对可执行程序进行了封装,提供了工具这个概念:
+此接口也是用于查找可执行程序,不过比[lib.detect.find_program](#detectfind_program)更加的高级,功能也更加强大,它对可执行程序进行了封装,提供了工具这个概念:
* toolname: 工具名,可执行程序的简称,用于标示某个工具,例如:`gcc`, `clang`等
* program: 可执行程序命令,例如:`xcrun -sdk macosx clang`
@@ -1402,7 +1402,7 @@ find_package("brew::pcre2/libpcre2-8")
| gcc | `/usr/toolchains/bin/arm-linux-gcc` |
| link | `link.exe -lib` |
-[lib.detect.find_program](#detect-find_program)只能通过传入的原始program命令或路径,去判断该程序是否存在。
+[lib.detect.find_program](#detectfind_program)只能通过传入的原始program命令或路径,去判断该程序是否存在。
而`find_tool`则可以通过更加一致的toolname去查找工具,并且返回对应的program完整命令路径,例如:
```lua
@@ -1529,7 +1529,7 @@ local devices = find_cudadevices({ min_sm_arch = 35, order_by_flops = true })
- 获取指定工具的所有特性
-此接口跟[compiler.features](#compiler-features)类似,区别就是此接口更加的原始,传入的参数是实际的工具名toolname。
+此接口跟[compiler.features](#compilerfeatures)类似,区别就是此接口更加的原始,传入的参数是实际的工具名toolname。
并且此接口不仅能够获取编译器的特性,任何工具的特性都可以获取,因此更加通用。
@@ -1543,13 +1543,13 @@ local features = features("clang", {flags = {"-g", "-O0", "-std=c++11"}})
通过传入flags,可以改变特性的获取结果,例如一些c++11的特性,默认情况下获取不到,通过启用`-std=c++11`后,就可以获取到了。
-所有编译器的特性列表,可以见:[compiler.features](#compiler-features)。
+所有编译器的特性列表,可以见:[compiler.features](#compilerfeatures)。
#### detect.has_features
- 判断指定特性是否支持
-此接口跟[compiler.has_features](#compiler-has_features)类似,但是更加原始,传入的参数是实际的工具名toolname。
+此接口跟[compiler.has_features](#compilerhas_features)类似,但是更加原始,传入的参数是实际的工具名toolname。
并且此接口不仅能够判断编译器的特性,任何工具的特性都可以判断,因此更加通用。
@@ -1563,13 +1563,13 @@ local features = has_features("clang", {"cxx_constexpr", "c_static_assert"}, {fl
如果指定的特性列表存在,则返回实际支持的特性子列表,如果都不支持,则返回nil,我们也可以通过指定flags去改变特性的获取规则。
-所有编译器的特性列表,可以见:[compiler.features](#compiler-features)。
+所有编译器的特性列表,可以见:[compiler.features](#compilerfeatures)。
#### detect.has_flags
- 判断指定参数选项是否支持
-此接口跟[compiler.has_flags](#compiler-has_flags)类似,但是更加原始,传入的参数是实际的工具名toolname。
+此接口跟[compiler.has_flags](#compilerhas_flags)类似,但是更加原始,传入的参数是实际的工具名toolname。
```lua
import("lib.detect.has_flags")
@@ -1587,7 +1587,7 @@ local ok = has_flags("clang", "-g -O0", {toolkind = "cxx"})
- 判断指定c函数是否存在
-此接口是[lib.detect.check_cxsnippets](#detect-check_cxsnippets)的简化版本,仅用于检测函数。
+此接口是[lib.detect.check_cxsnippets](#detectcheck_cxsnippets)的简化版本,仅用于检测函数。
```lua
import("lib.detect.has_cfuncs")
@@ -1616,13 +1616,13 @@ local ok = has_cfuncs({"sigsetjmp((void*)0, 0)", "setjmp"}, {includes = "setjmp.
- 判断指定c++函数是否存在
-此接口跟[lib.detect.has_cfuncs](#detect-has_cfuncs)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++函数。
+此接口跟[lib.detect.has_cfuncs](#detecthas_cfuncs)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++函数。
#### detect.has_cincludes
- 判断指定c头文件是否存在
-此接口是[lib.detect.check_cxsnippets](#detect-check_cxsnippets)的简化版本,仅用于检测头文件。
+此接口是[lib.detect.check_cxsnippets](#detectcheck_cxsnippets)的简化版本,仅用于检测头文件。
```lua
import("lib.detect.has_cincludes")
@@ -1636,13 +1636,13 @@ local ok = has_cincludes({"stdio.h", "stdlib.h"}, {config = {defines = "_GNU_SOU
- 判断指定c++头文件是否存在
-此接口跟[lib.detect.has_cincludess](#detect-has_cincludes)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++头文件。
+此接口跟[lib.detect.has_cincludess](#detecthas_cincludes)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++头文件。
#### detect.has_ctypes
- 判断指定c类型是否存在
-此接口是[lib.detect.check_cxsnippets](#detect-check_cxsnippets)的简化版本,仅用于检测函数。
+此接口是[lib.detect.check_cxsnippets](#detectcheck_cxsnippets)的简化版本,仅用于检测函数。
```lua
import("lib.detect.has_ctypes")
@@ -1656,7 +1656,7 @@ local ok = has_ctypes("wchar_t", {includes = {"stdio.h", "stdlib.h"}, config = {
- 判断指定c++类型是否存在
-此接口跟[lib.detect.has_ctypess](#detect-has_ctypes)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++类型。
+此接口跟[lib.detect.has_ctypess](#detecthas_ctypes)类似,请直接参考它的使用说明,唯一区别是这个接口用于检测c++类型。
#### detect.check_cxsnippets
@@ -1664,7 +1664,7 @@ local ok = has_ctypes("wchar_t", {includes = {"stdio.h", "stdlib.h"}, config = {
通用的c/c++代码片段检测接口,通过传入多个代码片段列表,它会自动生成一个编译文件,然后常识对它进行编译,如果编译通过返回true。
-对于一些复杂的编译器特性,连[compiler.has_features](#compiler-has_features)都无法检测到的时候,可以通过此接口通过尝试编译来检测它。
+对于一些复杂的编译器特性,连[compiler.has_features](#compilerhas_features)都无法检测到的时候,可以通过此接口通过尝试编译来检测它。
```lua
import("lib.detect.check_cxsnippets")
@@ -1673,7 +1673,7 @@ local ok = check_cxsnippets("void test() {}")
local ok = check_cxsnippets({"void test(){}", "#define TEST 1"}, {types = "wchar_t", includes = "stdio.h"})
```
-此接口是[detect.has_cfuncs](#detect-has_cfuncs), [detect.has_cincludes](#detect-has_cincludes)和[detect.has_ctypes](detect-has_ctypes)等接口的通用版本,也更加底层。
+此接口是[detect.has_cfuncs](#detecthas_cfuncs), [detect.has_cincludes](#detecthas_cincludes)和[detect.has_ctypes](detect-has_ctypes)等接口的通用版本,也更加底层。
因此我们可以用它来检测:types, functions, includes 还有 links,或者是组合起来一起检测。