-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
cmake build error, when using static libidn2 #14845
Comments
Supporting builds with static dependencies and keeping that working over time is some serious pain inflicting activity. |
Thanks for your report. There has been changes around this in the latest master. Can you give it a try to see how it behaves in this scenario? |
Check master (4a382f4) |
Thanks for testing! Would you mind posting all the |
it from CMakeCache |
Thanks, it means also It's hard to say on what conditions shall a project pick up the The general question is: how to select static vs. shared libs for specific targets and their specific dependencies. Since this would be too fiddly for most practical use-case: What options to offer that satisfy most static vs shared use-cases? (that also works smoothly across the supported build-cases) Till these questions get answers, I suggest feeding the build with the necessary libs and paths manually: As @bagder mentioned, static builds are generally a pain, and especially to automate them across all build cases. |
As i understand there are no billt-in CMake option for that. Only what i found similar this. |
Yes, one option is to let the curl build know whether to use STATIC vs default for linking with curl and/or libcurl. This will first bump into the issue that the recently introduced native The next question is how well would such option work across all dependencies when using their Being TL;DR it can get complicated. Also difficult to test or guesstimate what happens when doing these. Probably the best to do now is add this to the KNOWN_BUGS document. |
I think it is more of a known restriction than a bug. It is the same for autotools: building with static dependencies is a Sisyphean task. Better leave that for the user to provide the dependencies. |
I'm fine with this. Perhaps step by step it can be improved to a certain point, but to fully automate might indeed be an unrealistic goal. |
I did this
Building curl-8.9.1 by cmake (mingw toolchain), with options
-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DUSE_LIBIDN2=ON
It found idn2-2.3.7, but on build stage many "undefined reference"
undefined reference to
u8_strlen' undefined reference to
u8_to_u32'undefined reference to `u32_to_u8'
...
As i understand from pkg_check_modules() in CMakeLists.txt only using LIBIDN2_INCLUDE_DIRS.
I examine CMakeCache file, for static lib (idn2) pkg_check_modules() give necessary LDFLAGS in LIBIDN2_STATIC_LDFLAGS.
There are flags for linking with iconv unistring and paths.
I expected the following
Build without error
curl/libcurl version
curl 8.9.1
operating system
Gentoo
The text was updated successfully, but these errors were encountered: