]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Find CppHttplib named libhttplib.so as well (#1465)
authorSam James <sam@gentoo.org>
Sat, 8 Jun 2024 14:11:48 +0000 (15:11 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Jun 2024 14:11:48 +0000 (16:11 +0200)
On Gentoo, the library name is 'httplib', not 'cpp-httplib'. Search
for that first (as it appears to be "more vanilla"), then fall back
to 'cpp-httplib'.

cmake/FindCppHttplib.cmake

index d74ad3237b850bfca240c4ede3fe0122b0bf7d20..49d80d6e5b273696d282afe6fc78d03c92b3066e 100644 (file)
@@ -12,7 +12,11 @@ else()
     if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_cpphttplib_version_string}" VERSION_GREATER_EQUAL "${CppHttplib_FIND_VERSION}")
       # Some dists like Fedora package cpp-httplib as a single header while some
       # dists like Debian package it as a traditional library.
-      find_library(CPPHTTPLIB_LIBRARY cpp-httplib)
+      find_library(CPPHTTPLIB_LIBRARY httplib)
+      if(NOT CPPHTTPLIB_LIBRARY)
+        find_library(CPPHTTPLIB_LIBRARY cpp-httplib)
+      endif()
+
       if(CPPHTTPLIB_LIBRARY)
         message(STATUS "Using system CppHttplib (${CPPHTTPLIB_LIBRARY})")
         add_library(dep_cpphttplib UNKNOWN IMPORTED)