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

关于cmake 中INTERFACE_LINK_LIBRARIES 概念,xmake中如何处理?(使用gflags 库产生的问题) #1750

Closed
prehonor opened this issue Oct 18, 2021 · 3 comments

Comments

@prehonor
Copy link

因为我本地编译安装的gflags(使用cmake),我看到gflags产生一些.cmake 文件,其中有INTERFACE_LINK_LIBRARIES 这个东西,单纯的使用pkg-config 会丢失 INTERFACE_LINK_LIBRARIES 指出的库,我在xmake 暂时使用 set_config("ldflags", "-lpthread") 解决了glfags 的INTERFACE_LINK_LIBRARIES 指出的pthread ,请问xmake有没有更好的方法解决INTERFACE_LINK_LIBRARIES?

@waruqi
Copy link
Member

waruqi commented Oct 18, 2021

add_links add_syslinks

@xq114
Copy link
Contributor

xq114 commented Oct 18, 2021

目前dev版本的从cmake引入库应该可以解决你的问题,具体看 #1632

不更新到dev的话,也可以本地包装一下cmake库,见 #1714 ,在package描述中只要加一行

if is_plat("linux") then
    add_syslinks("pthread")
end

参考xmake-repo中 https://github.com/xmake-io/xmake-repo/blob/master/packages/g/gflags/xmake.lua

@prehonor
Copy link
Author

ok,感谢答复

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

No branches or pull requests

3 participants