-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
fix_poco_shared_build #4994
fix_poco_shared_build #4994
Conversation
SnowinterCat
commented
Aug 20, 2024
•
edited
Loading
edited
- Fix Poco libraries cannot compile with shared build on Windows
- Fix: Compiling Poco's xml module has some problems due to missing macros with the expat static library. Appending macros directly will cause to fail to compile Poco with a dynamic expat library. Change some previous code to be executed only when expat is a static library.
- Fix: Compiling Poco's foundation module has some problems due to missing macros with the pcre2 static library. Appending macros directly will cause to fail to compile Poco with a dynamic pcre2 library. Change some previous code to be executed only when pcre2 is a static library.
- Refine the Poco library modules so that you don't need to install the entire Poco library if you only need a small part of it.
- Provide the option of mariadb when using the MySql module in Poco (not selectable at the same time as mysql).
Poco库的mysql模块本身是支持Mysql或者MariaDB的,不过它的头文件里面写死了使用
但是xmake-repo编译出来的MariaDB的头文件是: mariadb/mysql.h
都改成了
来进行支持。 |
The mysql module of the Poco library itself supports Mysql or MariaDB, but its use is hard-coded in its header file.
But the header file of MariaDB compiled by xmake-repo is: mariadb/mysql.h
All changed to
to support. |
packages/p/poco/xmake.lua
Outdated
@@ -16,52 +16,129 @@ package("poco") | |||
add_versions("1.12.5", "92b18eb0fcd2263069f03e7cc80f9feb43fb7ca23b8c822a48e42066b2cd17a6") | |||
add_versions("1.13.3", "9f074d230daf30f550c5bde5528037bdab6aa83b2a06c81a25e89dd3bcb7e419") | |||
|
|||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean"}) | |||
add_configs("debug", {description = "Build debug library.", default = false, type = "boolean"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两原本就是内置 config 不用加
packages/p/poco/xmake.lua
Outdated
-- Rewrite to xmake: | ||
-- if package:config("active_record") then | ||
-- package:config_set("data", true) | ||
-- end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释去掉
可以 |
Can |
这个 patch break 了 boost
|
packages/p/poco/xmake.lua
Outdated
package:add("deps", "mysql") | ||
end | ||
assert(not (package:has_runtime("MT", "MTd") and package:config("shared")), "Poco cannot have both BUILD_SHARED_LIBS and POCO_MT") | ||
assert(not (package:config("mysql") and package:config("mariadb")), "Poco's options 'mysql' and 'mariadb' cannot exist together") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种检测放到 on_check 里面去做
packages/p/poco/xmake.lua
Outdated
local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*") | ||
assert(tonumber(build_ver) >= 18362, "poco requires Windows SDK to be at least 10.0.18362.0") | ||
table.insert(configs, "-DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=" .. vs_sdkver) | ||
table.insert(configs, "-DCMAKE_SYSTEM_VERSION=" .. vs_sdkver) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configs 就不要加到 check 了。。
table.insert(configs, "-DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=" .. vs_sdkver) | ||
table.insert(configs, "-DCMAKE_SYSTEM_VERSION=" .. vs_sdkver) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 configs 设置删来干嘛
在android平台上的armeabi-v7a架构r22中,会因为pcre2需要大于r22的ndk而失败,但是在arm64-v8a架构r22下不会,这个是什么原因呢? |
In the armeabi-v7a architecture r22 on the android platform, it will fail because pcre2 requires an ndk larger than r22, but it will not fail in the arm64-v8a architecture r22. What is the reason for this? |
这个Wasm平台会出现poco找不到pcre2,这就很奇怪了。我手动指定了pcre2的路径也不行,我只能暂时让poco不支持wasm了 |
This Wasm platform will show that poco cannot find pcre2, which is very strange. Even if I manually specify the path to pcre2, it doesn't work. I can only temporarily disable poco from supporting wasm. |
因为 pcre2 加了 on_check 过滤 ci #4173 |
这个不知道是 cmake or xmake 的原因,很多包在 wasm 平台上总是 find_package 失败 |
I don’t know if this is caused by cmake or xmake. Many packages always fail to find_package on the wasm platform. |
我其实是奇怪,为什么armeabi-v7a架构r22会报错 need ndk > 22,但是arm64-v8a架构r22 不会报错 need ndk > 22。就不是很方便做检查。不过既然pcre2已经有这个检查了,那poco应该就没必要加了吧 |
I am actually curious why the armeabi-v7a architecture r22 will report the error need ndk > 22, but the arm64-v8a architecture r22 will not report the error need ndk > 22. It is not very convenient for inspection. But since pcre2 already has this check, there should be no need for poco to add it. |
@waruqi 这下应该正式完工了,如果只有三个因为pcre2的ndk版本导致的失败的话 |
最后的on_test中注释掉的那5个是exe,没有头文件我不清楚怎么测试。等以后别人来补充吧 |
所以如果全部编译,应该是22个dll(MySql模块和MariaDB模块冲突),加上Windows特供的NetSSL_Win.dll,一共23个;加上5个exe |
@waruqi It should be officially completed now, if there are only three failures caused by the ndk version of pcre2 |
The 5 commented out in the last on_test are exe. I don’t know how to test without the header file. Let others add it later. |
So if you compile them all, there should be 22 dlls (the MySql module conflicts with the MariaDB module), plus NetSSL_Win.dll specially provided for Windows, a total of 23; plus 5 exes |