-
Notifications
You must be signed in to change notification settings - Fork 868
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
Static library always built with identical lib name as shared causing linking errors #2088
Comments
|
Initially reported (and a fix) through #2051 (comment) |
We should probably notify all packagers of 1.60.0 that the |
@jonaski do you want to submit a pull request? It seems your solution is more detailed than mine :) Mine is a quick fix for 1.60.0 packagers, but it sounds like you have the proper way. thanks. |
Also, I think we should be testing for this (I'm not familiar with the CI for windows for this project), on each commit, to prevent such a breaking change occurring in a release again. |
I can do it. |
Respect BUILD_STATIC_LIBS, default to ON since the tests require it, but still it possible to turn it manually off, if BUILD_STATIC_LIBS is OFF do not include tests. This also fixes the library conflict by removing the ARCHIVE_OUTPUT_NAME property so it's using "nghttp2_static", since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS, default to ON since the tests require it, but still make it possible to turn it off, if BUILD_STATIC_LIBS is OFF do not include tests. This also fixes the library conflict by removing the ARCHIVE_OUTPUT_NAME property so it's using "nghttp2_static", since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS, default to ON since the tests require it, but still make it possible to turn it off, if BUILD_STATIC_LIBS is OFF do not include tests. This also fixes the library conflict by removing the ARCHIVE_OUTPUT_NAME property so it's using "nghttp2_static", since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS and add option for tests. This also fixes the library conflict by removing the ARCHIVE_OUTPUT_NAME property so it's using "nghttp2_static", since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS and add option for tests. This also fixes the library conflict with MSVC by setting the STATIC_LIB_SUFFIX so it's using "nghttp2_static" with both static and shared library is built, since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS and add option for tests. This also fixes the library conflict with MSVC by setting STATIC_LIB_SUFFIX so it's using "nghttp2_static" when both static and shared library is built, since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
Respect BUILD_STATIC_LIBS and add option for tests. This also fixes the library conflict with MSVC by setting STATIC_LIB_SUFFIX so it's using "nghttp2_static" when both static and shared library is built, since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes #2088
Respect BUILD_STATIC_LIBS and add option for tests. This also fixes the library conflict with MSVC by setting STATIC_LIB_SUFFIX so it's using "nghttp2_static" when both static and shared library is built, since the lib name currently conflicts with the shared when STATIC_LIB_SUFFIX was not set. Fixes nghttp2#2088
As you have removed the
if(HAVE_CUNIT OR ENABLE_STATIC_LIB)
condition in version 1.60.0, it's always building the static library, even though I explicitly have been disabling it withENABLE_STATIC_LIB=OFF
, and since 1.60.0 withBUILD_STATIC_LIBS=OFF
.STATIC_LIB_SUFFIX
is never set, but is used here:nghttp2/lib/CMakeLists.txt
Line 74 in c5e087b
But without
STATIC_LIB_SUFFIX
being set, the static library is using identical lib name as the shared lib causing linking errors, as you can see here: https://github.com/strawberrymusicplayer/strawberry-msvc-dependencies/actions/runs/8115697967/job/22184102638?pr=370This means the user has to configure CMake with
STATIC_LIB_SUFFIX
to avoid the conflict when building a shared library.The
if(BUILD_STATIC_LIBS)
line should be moved so it does not only apply to the install, but building too.And
STATIC_LIB_SUFFIX
should probably be CMake option defaulting to "static" so it does create conflicts when building both shared and static.The text was updated successfully, but these errors were encountered: