Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load environment variable from dependencies besides msvc #1483

Closed
xq114 opened this issue Jul 2, 2021 · 3 comments
Closed

Load environment variable from dependencies besides msvc #1483

xq114 opened this issue Jul 2, 2021 · 3 comments

Comments

@xq114
Copy link
Contributor

xq114 commented Jul 2, 2021

注:如果是问题报障或者特性请求,请选择报告缺陷特性请求模板,否则一律不回复。

xmake-io/xmake-repo#463

这里给cmake加载了msvc,但丢失了nasm等依赖的环境变量,情况类似于package.tools.nmake/package.tools.meson,见https://github.com/xq114/xmake-repo/actions/runs/992556214

更进一步,如果提供一个os.joinenv的接口则更好,可在package内更方便地修改环境变量

@waruqi
Copy link
Member

waruqi commented Jul 2, 2021

加了个 os.joinenvs(envs, oldenvs) 如果 oldenvs 为 nil,默认用 os.getenvs()

另外 tools/gn, cmake, nmake, msbuild, meson 里面的 envs 我都更新过了。。

等 ci 上过了再试试

@xq114
Copy link
Contributor Author

xq114 commented Jul 2, 2021

环境变量的问题解决了;另一个问题是走cmake->msbuild路线的时候无法指定是否并行

function _build_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
local runenvs = _get_msvc_runenvs(package)
local msbuild = find_tool("msbuild", {envs = runenvs})
os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m",
"-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"),
"-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
end

open3d里面不支持ninja只支持msbuild,并且要求cmake后的msbuild必须串行不能并行,能否加一个指令指定是否开启并行(-m)?

@waruqi
Copy link
Member

waruqi commented Jul 2, 2021

那你帮忙开个pr直接改下就好了,也就几行代码。我可能要明晚才有时间了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants