-
-
Notifications
You must be signed in to change notification settings - Fork 817
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
动态库依赖 abseil 时,链接报错提示 abseil 非 -fPIC 编译,即使加上选项 #5816
Comments
Title: When the dynamic library depends on abseil, the link error prompts that abseil is not compiled with -fPIC, even if the option is added |
pic 默认开启的,会传给 cmake 项目 xmake.lua 各种操作都不会影响 package 的构建,额外操作都在 add_requires("abseil", {configs = {cxflags = "-fPIC"}}) |
Pic is enabled by default and will be passed to cmake Various operations of the project xmake.lua will not affect the construction of the package, and additional operations are controlled by add_requires("abseil", {configs = {cxflags = "-fPIC"}}) |
目前 交叉编译对 cmake 包,默认没处理 pic ,就只对处理 linux/bsd 处理了。主要是之前我不确定所有交叉编译工具链是否都支持 pic 我先暂时放开了,让 cmake 自己去处理好了。 试下这个 patch #5817 |
Currently, cross-compilation does not process pic by default for the cmake package, but only processes linux/bsd. Mainly because I was not sure whether all cross-compilation tool chains support pic before I let go temporarily and let cmake handle it by itself. |
Xmake 版本
2.9.6
操作系统版本和架构
Ubuntu 23.04
描述问题
如题,手动加上 cxflags -fPIC 和 requires 里 configs 设置都不行
期待的结果
成功链接
工程配置
add_rules("mode.debug", "mode.release")
add_cxflags("-fPIC")
add_requires("abseil", {configs = {pic = true}})
add_requires("spdlog")
target("mylib")
set_kind("shared")
set_languages("c++20")
add_packages("abseil", "spdlog")
add_files("./src/*.cpp")
set_toolchains("clang")
附加信息和错误日志
The text was updated successfully, but these errors were encountered: