]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: set `CURL_STATICLIB` for static lib when `SHARE_LIB_OBJECT=OFF`
authorchemodax <53048645+chemodax@users.noreply.github.com>
Thu, 5 Dec 2024 16:52:12 +0000 (17:52 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 5 Dec 2024 19:52:01 +0000 (20:52 +0100)
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

lib/CMakeLists.txt

index 895bc9165abca786fa3c4d66a0e528470a9ee787..aea8616b25eebb04452ebdd2b39869be15206498 100644 (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".