]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: avoid `list(PREPEND)` for compatibility
authorViktor Szakats <commit@vsz.me>
Thu, 18 May 2023 21:02:17 +0000 (21:02 +0000)
committerViktor Szakats <commit@vsz.me>
Sat, 20 May 2023 11:50:40 +0000 (11:50 +0000)
`list(PREPEND)` requires CMake v3.15, our minimum is v3.7.

Ref: https://cmake.org/cmake/help/latest/command/list.html#prepend

Regression from 1e3319a167d2f32d295603167486e9e88af9bb4e

Reported-by: Keitagit-kun on Github
Fixes #11141
Closes #11144

CMakeLists.txt

index a0fe76c244d42e096b5b1a5572d9259dbed0d61b..49a44eabf80df7f642ea8d19da367f18ef99ce91 100644 (file)
@@ -525,7 +525,7 @@ if(CURL_BROTLI)
   find_package(Brotli QUIET)
   if(BROTLI_FOUND)
     set(HAVE_BROTLI ON)
-    list(PREPEND CURL_LIBS ${BROTLI_LIBRARIES})
+    set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}")  # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with <v3.15 CMake.
     list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
     include_directories(${BROTLI_INCLUDE_DIRS})
     list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS})