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

Improve find system library files #5433

Open
star-hengxing opened this issue Aug 4, 2024 · 18 comments
Open

Improve find system library files #5433

star-hengxing opened this issue Aug 4, 2024 · 18 comments

Comments

@star-hengxing
Copy link
Contributor

Is your feature request related to a problem? Please describe.

#5066 (comment)

Describe the solution you'd like

N/A

Describe alternatives you've considered

No response

Additional context

No response

@xq114
Copy link
Contributor

xq114 commented Aug 6, 2024

#5384

@star-hengxing
Copy link
Contributor Author

#5384

目前 apt/pacman 等系统包管理还没支持提取 libfiles 来适配 add_packages("zlib", {linkpath = true})

补充相关讨论 #5432

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


#5384

Currently, system package management such as apt/pacman does not support extracting libfiles to adapt add_packages("zlib", {linkpath = true})

Supplement related discussions #5432

@waruqi
Copy link
Member

waruqi commented Aug 6, 2024

apt 里有对 libfiles 的查找

table.insert(result.libfiles, path.join(path.directory(line), path.filename(line)))

还有 vcpkg conan里也有支持。。其他的暂时没有

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


There is a search for libfiles in apt

table.insert(result.libfiles, path.join(path.directory(line), path.filename(line)))

There is also support in vcpkg conan. . There are no others at the moment

@KkemChen
Copy link

KkemChen commented Aug 7, 2024

话说 add_requires(apt::xxxx)
会链接静态库还是动态库

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Say add_requires(apt::xxxx)
Will it be linked to a static library or a dynamic library?

@waruqi
Copy link
Member

waruqi commented Aug 7, 2024

pacman 的加上了 #5446

@waruqi waruqi added this to the v2.9.5 milestone Aug 7, 2024
@waruqi waruqi changed the title Improve find system library Improve find system library files Aug 7, 2024
@star-hengxing
Copy link
Contributor Author

有些系统包管理同时提供静态库和动态库,比如 msys2 pacman,这个能用 configs shared 配置么

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Some system package managers provide both static libraries and dynamic libraries, such as msys2 pacman. Can this be configured using configs shared?

@waruqi
Copy link
Member

waruqi commented Aug 7, 2024

有些系统包管理同时提供静态库和动态库,比如 msys2 pacman,这个能用 configs shared 配置么

暂时支持不了,这种就没法走 -L/-l 了,只能强制走 linkpath 完整路径,目前它是在 add_packages 阶段决策的,没法在 find_package 阶段搞。。

那就要在 add_packages 阶段 去根据 configs linkpath 区分处理了。。这个时候 configs 信息也没了,还得单独缓存特殊处理。。有点复杂,懒得搞。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Some system package managers provide both static libraries and dynamic libraries, such as msys2 pacman. Can this be configured using configs shared?

It is not supported for the time being. This method cannot be used with -L/-l. It can only be forced to use the full linkpath path. Currently, it is determined in the add_packages stage and cannot be done in the find_package stage. .

Then we need to distinguish between configs linkpath in the add_packages stage. . At this time, the configs information is gone and must be cached separately for special processing. . It's a bit complicated and I'm too lazy to do it.

@KkemChen
Copy link

KkemChen commented Aug 8, 2024

有些系统包管理同时提供静态库和动态库,比如 msys2 pacman,这个能用 configs shared 配置么

暂时支持不了,这种就没法走 -L/-l 了,只能强制走 linkpath 完整路径,目前它是在 add_packages 阶段决策的,没法在 find_package 阶段搞。。

那就要在 add_packages 阶段 去根据 configs linkpath 区分处理了。。这个时候 configs 信息也没了,还得单独缓存特殊处理。。有点复杂,懒得搞。

强烈要求 apt的库也能指定 shared或static ✊
提上日程.jgp

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Some system package managers provide both static libraries and dynamic libraries, such as msys2 pacman. Can this be configured using configs shared?

It is not supported for the time being. This method cannot be used with -L/-l. It can only be forced to use the full linkpath path. Currently, it is decided in the add_packages stage and cannot be done in the find_package stage. .

Then we need to distinguish between configs linkpath in the add_packages stage. . At this time, the configs information is gone and must be cached separately for special processing. . It's a bit complicated and I'm too lazy to do it.

It is strongly requested that the apt library can also specify shared or static ✊
Put it on the agenda.jgp

@xq114
Copy link
Contributor

xq114 commented Aug 8, 2024

有些系统包管理同时提供静态库和动态库,比如 msys2 pacman,这个能用 configs shared 配置么

暂时支持不了,这种就没法走 -L/-l 了,只能强制走 linkpath 完整路径,目前它是在 add_packages 阶段决策的,没法在 find_package 阶段搞。。

那就要在 add_packages 阶段 去根据 configs linkpath 区分处理了。。这个时候 configs 信息也没了,还得单独缓存特殊处理。。有点复杂,懒得搞。

不需要,加-Wl,-Bstatic或者-Wl,-Bdynamic就行了

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Some system package managers provide both static libraries and dynamic libraries, such as msys2 pacman. Can this be configured using configs shared?

It is not supported for the time being. This method cannot be used with -L/-l. It can only be forced to use the full linkpath path. Currently, it is decided in the add_packages stage and cannot be done in the find_package stage. .

Then we need to distinguish between configs linkpath in the add_packages stage. . At this time, the configs information is gone and must be cached separately for special processing. . It's a bit complicated and I'm too lazy to do it.

No, just add -Wl,-Bstatic or -Wl,-Bdynamic.

@star-hengxing
Copy link
Contributor Author

那就要在 add_packages 阶段 去根据 configs linkpath 区分处理了。。这个时候 configs 信息也没了,还得单独缓存特殊处理。。有点复杂,懒得搞。

那只在 find package 做这一步,暂时不考虑 linkpath 应该可以吧

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Then we need to distinguish between configs linkpath in the add_packages stage. . At this time, the configs information is gone and must be cached separately for special processing. . It's a bit complicated and I'm too lazy to do it.

Then only do this step in find package, and it should be okay to ignore linkpath for the time being.

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

5 participants