From: chemodax <53048645+chemodax@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:52:12 +0000 (+0100) Subject: cmake: set `CURL_STATICLIB` for static lib when `SHARE_LIB_OBJECT=OFF` X-Git-Tag: curl-8_11_1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6aecd4a9838ee92d2ca104a9ad5781b8f41839d;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 895bc9165a..aea8616b25 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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".