cmake: set CURL_STATICLIB for static lib when SHARE_LIB_OBJECT=OFF

When compiled with BUILD_STATIC_LIBS=ON and SHARE_LIB_OBJECT=OFF compile
definition CURL_STATICLIB was not set for static library. It seems to be
copy-paste error in the lib/CMakeLists.txt.

This pull request fixes it.

Closes #15695
This commit is contained in:
chemodax 2024-12-05 17:52:12 +01:00 committed by Viktor Szakats
parent ce949ba1dc
commit b6aecd4a98
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -125,7 +125,7 @@ if(BUILD_STATIC_LIBS)
add_library(${LIB_STATIC} STATIC ${LIB_SOURCE})
add_library(${PROJECT_NAME}::${LIB_STATIC} ALIAS ${LIB_STATIC})
if(WIN32)
set_property(TARGET ${LIB_OBJECT} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB")
set_property(TARGET ${LIB_STATIC} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB")
endif()
target_link_libraries(${LIB_STATIC} PRIVATE ${CURL_LIBS})
# Remove the "lib" prefix since the library is already named "libcurl".