aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-04-01 22:40:33 +0800
committerruki <waruqi@gmail.com>2019-04-01 10:03:22 +0800
commit74f0e8c43811b6dd6361592905b6dd3c12496706 (patch)
tree945fd0291f9ad83800e78351c9221faf4070a1f2
parentf94bfa4943c7d6cc4932b38a8578d678da978730 (diff)
downloadxmake-docs-74f0e8c43811b6dd6361592905b6dd3c12496706.tar.gz
xmake-docs-74f0e8c43811b6dd6361592905b6dd3c12496706.zip
update docs
-rw-r--r--README.md62
-rw-r--r--zh/README.md61
2 files changed, 121 insertions, 2 deletions
diff --git a/README.md b/README.md
index a0cf0c45..b5ef1835 100644
--- a/README.md
+++ b/README.md
@@ -1161,10 +1161,70 @@ package("openssl")
Some packages have various compile options at compile time, and we can pass them in. Of course, the package itself supports:
```lua
-add_requires("tbox", {config = {small=true}})
+add_requires("tbox", {configs = {small=true}})
```
Pass `--small=true` to the tbox package so that compiling the installed tbox package is enabled.
+
+##### Install third-party packages
+
+After version 2.2.5, xmake supports support for dependency libraries in third-party package managers, such as: conan, brew, vcpkg, etc.
+
+Add a homebrew dependency package:
+
+```lua
+add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("pcre2", "zlib")
+```
+
+Add a dependency package for vcpkg:
+
+```lua
+add_requires("vcpkg::zlib", "vcpkg::pcre2")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("vcpkg::zlib", "vcpkg::pcre2")
+```
+
+Add a conan dependency package:
+
+```lua
+add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl",
+ configs = {options = "OpenSSL:shared=True"}})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("openssl", "zlib")
+```
+
+After executing xmake to compile:
+
+```console
+ruki:test_package ruki$ xmake
+checking for the architecture ... x86_64
+checking for the Xcode directory ... /Applications/Xcode.app
+checking for the SDK version of Xcode ... 10.14
+note: try installing these packages (pass -y to skip confirm)?
+ -> CONAN::zlib/1.2.11@conan/stable (debug)
+ -> CONAN::OpenSSL/1.0.2n@conan/stable
+please input: y (y/n)
+
+ => installing CONAN::zlib/1.2.11@conan/stable .. ok
+ => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+
+[ 0%]: ccache compiling.release src/main.c
+[100%]: linking.release test
+```
+
##### Using self-built private package warehouse
If the required package is not in the official repository [xmake-repo](https://github.com/xmake-io/xmake-repo), we can submit the contribution code to the repository for support.
diff --git a/zh/README.md b/zh/README.md
index 70f5bcae..aff62b33 100644
--- a/zh/README.md
+++ b/zh/README.md
@@ -1249,11 +1249,70 @@ package("openssl")
某些包在编译时候有各种编译选项,我们也可以传递进来,当然包本身得支持:
```lua
-add_requires("tbox", {config = {small=true}})
+add_requires("tbox", {configs = {small=true}})
```
传递`--small=true`给tbox包,使得编译安装的tbox包是启用此选项的。
+##### 第三方依赖包安装
+
+2.2.5版本之后,xmake支持对对第三方包管理器里面的依赖库安装支持,例如:conan,brew, vcpkg等
+
+添加homebrew的依赖包:
+
+```lua
+add_requires("brew::zlib", {alias = "zlib"}})
+add_requires("brew::pcre2/libpcre2-8", {alias = "pcre2"}})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("pcre2", "zlib")
+```
+
+添加vcpkg的依赖包:
+
+```lua
+add_requires("vcpkg::zlib", "vcpkg::pcre2")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("vcpkg::zlib", "vcpkg::pcre2")
+```
+
+添加conan的依赖包:
+
+```lua
+add_requires("CONAN::zlib/1.2.11@conan/stable", {alias = "zlib", debug = true})
+add_requires("CONAN::OpenSSL/1.0.2n@conan/stable", {alias = "openssl",
+ configs = {options = "OpenSSL:shared=True"}})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.c")
+ add_packages("openssl", "zlib")
+```
+
+执行xmake进行编译后:
+
+```console
+ruki:test_package ruki$ xmake
+checking for the architecture ... x86_64
+checking for the Xcode directory ... /Applications/Xcode.app
+checking for the SDK version of Xcode ... 10.14
+note: try installing these packages (pass -y to skip confirm)?
+ -> CONAN::zlib/1.2.11@conan/stable (debug)
+ -> CONAN::OpenSSL/1.0.2n@conan/stable
+please input: y (y/n)
+
+ => installing CONAN::zlib/1.2.11@conan/stable .. ok
+ => installing CONAN::OpenSSL/1.0.2n@conan/stable .. ok
+
+[ 0%]: ccache compiling.release src/main.c
+[100%]: linking.release test
+```
+
##### 使用自建私有包仓库
如果需要的包不在官方仓库[xmake-repo](https://github.com/xmake-io/xmake-repo)中,我们可以提交贡献代码到仓库进行支持。