diff options
| author | ruki <[email protected]> | 2021-02-26 23:35:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-26 23:35:41 +0800 |
| commit | 26de431c60c5c596bde9ba7f5d3beb865906945b (patch) | |
| tree | 5316d5c97642cef646f627d36ae6d27bc8ff12de | |
| parent | 8a1528fdb97a228ae62113d3b6c1b4e0a3e19381 (diff) | |
update readme
| -rw-r--r-- | README.md | 51 | ||||
| -rw-r--r-- | README_zh.md | 51 |
2 files changed, 102 insertions, 0 deletions
@@ -248,6 +248,7 @@ muslcc The musl-based cross-compilation toolchains * REPL interactive execution support * Incremental compilation support, automatic analysis of header dependency files * Fast switching toolchains +* Automatic pull toolchain and dependency package integration ## Supported Projects @@ -368,6 +369,56 @@ target("loop") add_packages("libomp") ``` +#### Zig Program + +```lua +target("test") + set_kind("binary") + add_files("src/*.zig") +``` + +### Automatically fetch remote toolchain + +#### fetch the special version of llvm + +We use clang in llvm-10 to compile the project. + +```lua +add_requires("llvm 10.x", {alias = "llvm-10"}) +target("test") + set_kind("binary") + add_files("src/*.c) + set_toolchains("llvm@llvm-10") +```` + +#### Fetch cross-compilation toolchain + +We can also pull the specified cross-compilation tool chain to compile the project. + +```lua +add_requires("muslcc") +target("test") + set_kind("binary") + add_files("src/*.c) + set_toolchains("@muslcc") +``` + +#### Fetch toolchain and packages + +We can also use the specified muslcc cross-compilation toolchain to compile and integrate all dependent packages + +```lua +add_requires("muslcc") +add_requires("zlib", "libogg", {system = false}) + +set_toolchains("@muslcc") + +target("test") + set_kind("binary") + add_files("src/*.c") + add_packages("zlib", "libogg") +``` + ## Plugins #### Generate IDE project file plugin(makefile, vs2002 - vs2019 .. ) diff --git a/README_zh.md b/README_zh.md index 24959adb1..fdbb9404c 100644 --- a/README_zh.md +++ b/README_zh.md @@ -256,6 +256,7 @@ muslcc The musl-based cross-compilation toolchains * REPL 交互式执行支持 * 增量编译支持,头文件依赖自动分析 * 工具链的快速切换、定制化支持 +* 自动拉取工具链以及依赖包的快速整合 ## 工程类型 @@ -376,6 +377,56 @@ target("loop") add_packages("libomp") ``` +#### Zig 程序 + +```lua +target("test") + set_kind("binary") + add_files("src/*.zig") +``` + +### 自动拉取远程工具链 + +#### 拉取指定版本的 llvm 工具链 + +我们使用 llvm-10 中的 clang 来编译项目。 + +```lua +add_requires("llvm 10.x", {alias = "llvm-10"}) +target("test") + set_kind("binary") + add_files("src/*.c) + set_toolchains("llvm@llvm-10") +```` + +#### 拉取交叉编译工具链 + +我们也可以拉取指定的交叉编译工具链来编译项目。 + +```lua +add_requires("muslcc") +target("test") + set_kind("binary") + add_files("src/*.c) + set_toolchains("@muslcc") +``` + +#### 拉取工具链并且集成对应工具链编译的依赖包 + +我们也可以使用指定的muslcc交叉编译工具链去编译和集成所有的依赖包。 + +```lua +add_requires("muslcc") +add_requires("zlib", "libogg", {system = false}) + +set_toolchains("@muslcc") + +target("test") + set_kind("binary") + add_files("src/*.c") + add_packages("zlib", "libogg") +``` + ## 插件 #### 生成IDE工程文件插件(makefile, vs2002 - vs2019, ...) |
