From: Joel Rosdahl Date: Wed, 27 Mar 2024 19:02:50 +0000 (+0100) Subject: build: Let blake3 be a separate target not depended on by third_party X-Git-Tag: v4.10~42^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16db364b9a58f759667636c9f19cf1568e9575ef;p=thirdparty%2Fccache.git build: Let blake3 be a separate target not depended on by third_party --- diff --git a/.clang-format b/.clang-format index d41fa25d..64d9450f 100644 --- a/.clang-format +++ b/.clang-format @@ -31,7 +31,7 @@ IncludeCategories: - Regex: '^$' + - Regex: '^<(blake3\.h|cxxurl/url\.hpp|doctest/.*|fmt/.*|hiredis/.*|httplib\.h|nonstd/.*|tl/expected\.hpp|zstd\.h)>$' Priority: 3 # System headers: - Regex: '\.h.*>$' diff --git a/src/ccache/CMakeLists.txt b/src/ccache/CMakeLists.txt index 8169c98e..629a3617 100644 --- a/src/ccache/CMakeLists.txt +++ b/src/ccache/CMakeLists.txt @@ -45,6 +45,7 @@ find_package(Threads REQUIRED) target_link_libraries( ccache_framework PUBLIC + dep_blake3 dep_cxxurl dep_fmt dep_nonstdspan diff --git a/src/ccache/Hash.hpp b/src/ccache/Hash.hpp index 4e97b042..990b77bc 100644 --- a/src/ccache/Hash.hpp +++ b/src/ccache/Hash.hpp @@ -18,11 +18,10 @@ #pragma once +#include #include #include -#include - #include #include #include diff --git a/src/ccache/hashutil.cpp b/src/ccache/hashutil.cpp index efe978cb..c22f7b34 100644 --- a/src/ccache/hashutil.cpp +++ b/src/ccache/hashutil.cpp @@ -36,7 +36,7 @@ # include "InodeCache.hpp" #endif -#include +#include #ifdef HAVE_UNISTD_H # include diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index de420646..a3071d24 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -43,7 +43,6 @@ target_include_directories( ) target_link_libraries(third_party PRIVATE standard_settings) -target_link_libraries(third_party INTERFACE blake3) if(WIN32) target_link_libraries(third_party PRIVATE ws2_32) diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt index d2da244f..1d4ad944 100644 --- a/src/third_party/blake3/CMakeLists.txt +++ b/src/third_party/blake3/CMakeLists.txt @@ -1,6 +1,7 @@ -add_library(blake3 STATIC blake3.c blake3_dispatch_ccache.c blake3_portable.c) +add_library(dep_blake3 STATIC blake3.c blake3_dispatch_ccache.c blake3_portable.c) -target_link_libraries(blake3 PRIVATE standard_settings) +target_include_directories(dep_blake3 INTERFACE "${CMAKE_SOURCE_DIR}/src/third_party/blake3") +target_link_libraries(dep_blake3 PRIVATE standard_settings) if(MSVC) # No object file is created if masm is passed the compile options from standard_settings, @@ -74,7 +75,7 @@ function(add_source_if_enabled feature msvc_flags others_flags intrinsic) endif() if(${have_feature}) - target_sources(blake3 PRIVATE blake3_${feature}${suffix}) + target_sources(dep_blake3 PRIVATE blake3_${feature}${suffix}) if(suffix STREQUAL ".c") if(MINGW AND feature STREQUAL "avx512") # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782. @@ -121,4 +122,4 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) endif() file(GLOB headers *.h) -target_sources(blake3 PRIVATE ${headers}) +target_sources(dep_blake3 PRIVATE ${headers})