]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Fix detection and usage of system blake3 (#1464)
authorCarlo Cabrera <30379873+carlocab@users.noreply.github.com>
Fri, 31 May 2024 18:35:16 +0000 (02:35 +0800)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 18:35:16 +0000 (20:35 +0200)
cmake/FindBlake3.cmake
src/ccache/Hash.hpp
src/third_party/blake3/CMakeLists.txt

index 501353c9f1848f5a4ff058643a006342dd7061f8..f7d2a81ab9c93c29ad860fd226e937a12ab9173e 100644 (file)
@@ -8,7 +8,7 @@ else()
   find_library(BLAKE3_LIBRARY blake3)
   if(BLAKE3_INCLUDE_DIR)
     file(READ "${BLAKE3_INCLUDE_DIR}/blake3.h" _blake3_h)
-    string(REGEX MATCH "#define _blake3_version_string \"([0-9]+).([0-9]+).*([0-9]+)\"" _ "${_blake3_h}")
+    string(REGEX MATCH "#define BLAKE3_VERSION_STRING \"([0-9]+).([0-9]+).*([0-9]+)\"" _ "${_blake3_h}")
     set(_blake3_version_string "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
     if(NOT "${CMAKE_MATCH_0}" STREQUAL "" AND "${_blake3_version_string}" VERSION_GREATER_EQUAL "${Blake3_FIND_VERSION}")
       if(BLAKE3_LIBRARY)
index 4ac7503f723ead8cd925f8a4fa58e8ec859e166c..87be969cfeaa75e030db29e8f4b6cbf074d7a4f8 100644 (file)
 #include <ccache/util/PathString.hpp>
 #include <ccache/util/conversion.hpp>
 
-#include <blake3/blake3.h>
 #include <nonstd/span.hpp>
 #include <tl/expected.hpp>
 
+#include <blake3.h>
+
 #include <array>
 #include <cstdint>
 #include <cstdio>
index 8d0e9620cd3a56e570c1efe0d818d5be39cb0a01..0f69337d8cb92d9838104e292b809aaa0f584f43 100644 (file)
@@ -7,7 +7,7 @@ add_library(
   "${CMAKE_CURRENT_SOURCE_DIR}/blake3/blake3_portable.c"
 )
 
-target_include_directories(dep_blake3 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
+target_include_directories(dep_blake3 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/blake3")
 target_link_libraries(dep_blake3 PRIVATE standard_settings)
 
 if(MSVC)