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

vcpkg安装的三方库,使用xmake run,无法找到dll #565

Closed
Ultraman95 opened this issue Sep 2, 2019 · 13 comments
Closed

vcpkg安装的三方库,使用xmake run,无法找到dll #565

Ultraman95 opened this issue Sep 2, 2019 · 13 comments

Comments

@Ultraman95
Copy link

vcpkg安装的三方库,使用xmake run,无法找到dll
lua脚本如何写

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

我加上了。你更新下dev后再试试。。xmake update -s dev

@Ultraman95
Copy link
Author

我更新了,还是不行啊

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

那你先临时自己通过 add_runenvs("PATH", "xxxx") 添加下对应dll路径吧。。回头有时间我再看下

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

vcpkg安装的三方库

你是通过 add_requires集成的vcpkg还是通过find_packages集成的?

@Ultraman95
Copy link
Author

before_run(function (target)
os.addenv("PATH", "E:/Program Files/vcpkg/installed/x64-windows/bin")
end)
原来是这个办法
现在是add_runenvs("PATH", "xxxx")这个方法,怎么感觉总是在变化,不统一呢

@Ultraman95
Copy link
Author

add_runenvs这个方法文档里也找不到

@Ultraman95
Copy link
Author

我是通过 add_requires集成

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

add_runenvs

官方文档左上角,点搜索:add_runenvs

https://xmake.io/#/manual/project_target?id=targetadd_runenvs

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

before_run(function (target)
os.addenv("PATH", "E:/Program Files/vcpkg/installed/x64-windows/bin")
end)
原来是这个办法
现在是add_runenvs("PATH", "xxxx")这个方法,怎么感觉总是在变化,不统一呢

before_run里一直可用的,又没废弃,在before_run可以更加灵活的配置runenvs,对于一些不会写脚本的新手用户,以及对于仅仅只需要加个 path env的情况,特地去写before_run ,就稍显繁琐。。

提供add_runenvs仅仅只是为了帮助用户简化配置,在大部分情况下不需要写复杂的脚本,通过add_runenvs就可以满足日常path env修改的需求。。这跟是否统一根本没啥必然关系啊,是相辅相成的。。

你也可以继续使用 before_run ,如果你觉得不麻烦的话,又没有强制用户非得切到 add_runenvs来使用。。

@OpportunityLiu
Copy link
Member

before_run vs支持不了

@waruqi
Copy link
Member

waruqi commented Sep 2, 2019

我更新了,还是不行啊

@Ultraman95 你这装的什么vcpkg库,add_requires贴下,我这边调下之前那个dev patch

@waruqi
Copy link
Member

waruqi commented Sep 3, 2019

我看了下,是find_package vcpkg包的时候,相关dll所在的目录没做处理导致,回头我再改进下吧。。

@waruqi
Copy link
Member

waruqi commented Sep 3, 2019

@Ultraman95 我改进了下,应该可以了,不用再自己配置add_runenvs了,你更新下再试试 xmake update -s dev

记得加上-c清下之前的配置cache,重新检测下包路径

xmake f -c
xmake run

@waruqi waruqi added this to the v2.2.9 milestone Sep 3, 2019
@waruqi waruqi closed this as completed Sep 21, 2019
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

3 participants