-
-
Notifications
You must be signed in to change notification settings - Fork 432
libxml2: resolve missing dependencies when external libraries are needed for optional features #6805
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
Conversation
xrepo generally adheres to the principle of minimal dependencies and does not necessarily need to synchronize with upstream options. |
OK, I'll revert the last commit. |
iconv
support by default
Would it be convenient to define |
Thank you for the suggestion. It should generally be fine to reference non-existing dependencies. If a library is not installed as a dependency, it won't take effect or cause errors during the build process. Therefore, passing all possible dependencies might be a simpler and more concise approach. However, I'm open to further discussion if you think a more selective approach would be better. |
…ompatibility" This reverts commit 3468407.
@@ -142,7 +139,7 @@ package("libxml2") | |||
if lzma and not lzma:config("shared") then | |||
table.insert(cxflags, "-DLZMA_API_STATIC") | |||
end | |||
import("package.tools.cmake").install(package, configs, {cxflags = cxflags, shflags = shflags}) | |||
import("package.tools.cmake").install(package, configs, {cxflags = cxflags, shflags = shflags, packagedeps = {"libiconv", "icu4c", "zlib", "xz", "readline"}}) |
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.
We should pass dependencies as needed.
local packagedeps = {}
if package:config("zlib") then
table.insert(packagedeps, "zlib")
end
In addition, packagedeps are usually not needed, because cmake will automatically find them through add_deps, and xmake will automatically set CMAKE_PREFIX_PATH and PKG_CONFIG_PATH to let cmake/pkg-config find these dependent libraries.
Only when cmake really cannot find a library, packagedeps will be used as a hack to support it.
So don't pass all packagedeps at once without any test verification.
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.
Understood. I'll investigate the root cause of the build failures for Android when enabling iconv
, rather than using packagedeps
without proper testing. Thank you for the guidance.
This change enablesiconv
support by default forlibxml2
, aligning with its default configuration options.This PR addresses an issue where enabling
iconv
can cause build failures for Android due to missing dependencies. The error typically appears as: