Replies: 3 comments 1 reply
-
最新 dev 分支试试 |
Beta Was this translation helpful? Give feedback.
1 reply
-
谢谢指导,我找时间去尝试一下。还请问这个修改有计划的发布日期吗? |
Beta Was this translation helpful? Give feedback.
0 replies
-
目前要合并,只能自己在 before_build 里面,将所有的依赖包,自己 copy 到同一个地方 或者专门写个 custom rule 搞这个事情,方便复用 add_requires("zlib", {system = false})
target("test")
add_packages("zlib")
before_build(function (target)
for _, pkg in ipairs(target:pkgs()) do
local installdir = pkg:installdir()
os.cp(path.join(installdir, "include", "*"), path.join(target:buildir(), "xxxx", "include"))
-- TODO
end
end) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
想尝试一下xmake,目前有这么一个场景:
有一个已经成熟的 Rust 项目,Cargo.toml 中使用了 workspace,有多个子项目,部分子项目依赖了一些 C/C++ 库,希望能通过 xmake 自动构建C/C++库依赖
过去的做法:
上述流程工作得很完美,但是就是每个依赖的构建脚本都需要自己写
现在想了解一下能否将 xmake 构建好的所有依赖安装到同一个指定的目录中?include、lib、lib64、share等都安装到里面去
做法如下:
使用一个 phony target 指向现有的 Rust workspace 项目,什么也不干,连 cargo build 都不干(目前的 CMake 配置就是这么干的);然后在 xmake.lua 中声明各种依赖,和以前一样安装到<工作目录/构建目录>/build/install 目录下,这样添加新的依赖就简单明了多了
我在文档中看到了 XMAKE_PKG_INSTALLDIR 这个变量,但是这个只是让所有的依赖安装到了另一个目录,而不能通过一个目录下的 include、lib、lib64 等目录获取到所有依赖库的头文件和静态/动态库(我理解目前的做法能有效保障头文件和动态库冲突的情况,我其实也很喜欢),和我的需求不符
或者 Xmake 能够生成一个带有所有依赖包安装路径的文件也可以,这样就可以动态根据这个文件生成一个环境变量配置来自动设置所有的依赖寻找路径
还希望能够得到您的一些指点和建议@waruqi
Beta Was this translation helpful? Give feedback.
All reactions