xmake icon indicating copy to clipboard operation
xmake copied to clipboard

Improve find system library files

Open star-hengxing opened this issue 1 year ago • 18 comments

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

https://github.com/xmake-io/xmake/issues/5066#issuecomment-2108092571

Describe the solution you'd like

N/A

Describe alternatives you've considered

No response

Additional context

No response

star-hengxing avatar Aug 04 '24 01:08 star-hengxing

https://github.com/xmake-io/xmake/issues/5384

xq114 avatar Aug 06 '24 15:08 xq114

#5384

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

补充相关讨论 https://github.com/xmake-io/xmake/discussions/5432

star-hengxing avatar Aug 06 '24 15:08 star-hengxing

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 https://github.com/xmake-io/xmake/discussions/5432

Issues-translate-bot avatar Aug 06 '24 15:08 Issues-translate-bot

apt 里有对 libfiles 的查找

https://github.com/xmake-io/xmake/blob/b0524faed10267bfe351f79186c1cac649682223/xmake/modules/package/manager/apt/find_package.lua#L58

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

waruqi avatar Aug 06 '24 15:08 waruqi

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


There is a search for libfiles in apt

https://github.com/xmake-io/xmake/blob/b0524faed10267bfe351f79186c1cac649682223/xmake/modules/package/manager/apt/find_package.lua#L58

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

Issues-translate-bot avatar Aug 06 '24 15:08 Issues-translate-bot

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

KkemChen avatar Aug 07 '24 07:08 KkemChen

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?

Issues-translate-bot avatar Aug 07 '24 07:08 Issues-translate-bot

pacman 的加上了 https://github.com/xmake-io/xmake/pull/5446

waruqi avatar Aug 07 '24 08:08 waruqi

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

star-hengxing avatar Aug 07 '24 09:08 star-hengxing

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?

Issues-translate-bot avatar Aug 07 '24 09:08 Issues-translate-bot

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

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

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

waruqi avatar Aug 07 '24 14:08 waruqi

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.

Issues-translate-bot avatar Aug 07 '24 14:08 Issues-translate-bot

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

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

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

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

KkemChen avatar Aug 08 '24 06:08 KkemChen

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

Issues-translate-bot avatar Aug 08 '24 06:08 Issues-translate-bot

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

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

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

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

xq114 avatar Aug 08 '24 07:08 xq114

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.

Issues-translate-bot avatar Aug 08 '24 07:08 Issues-translate-bot

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

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

star-hengxing avatar Aug 08 '24 08:08 star-hengxing

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.

Issues-translate-bot avatar Aug 08 '24 08:08 Issues-translate-bot