Use SPDX license, and license for bundled libraries Unbundle libraries Add bundled provides
182 lines
6.2 KiB
Diff
182 lines
6.2 KiB
Diff
diff -up ccache-4.9.1/CMakeLists.txt.unbundle ccache-4.9.1/CMakeLists.txt
|
|
--- ccache-4.9.1/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700
|
|
+++ ccache-4.9.1/CMakeLists.txt 2024-02-08 08:24:25.196673454 -0700
|
|
@@ -86,6 +86,10 @@ include(GenerateVersionFile)
|
|
# Third party
|
|
#
|
|
|
|
+find_package(PkgConfig REQUIRED)
|
|
+
|
|
+pkg_check_modules(xxhash REQUIRED IMPORTED_TARGET libxxhash)
|
|
+
|
|
set(ZSTD_FROM_INTERNET AUTO CACHE STRING "Download and use libzstd from the Internet")
|
|
set_property(CACHE ZSTD_FROM_INTERNET PROPERTY STRINGS AUTO ON OFF)
|
|
|
|
diff -up ccache-4.9.1/src/CMakeLists.txt.unbundle ccache-4.9.1/src/CMakeLists.txt
|
|
--- ccache-4.9.1/src/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700
|
|
+++ ccache-4.9.1/src/CMakeLists.txt 2024-02-08 08:27:10.324913588 -0700
|
|
@@ -14,6 +14,7 @@ set(
|
|
hashutil.cpp
|
|
language.cpp
|
|
version.cpp
|
|
+ third_party/url.cpp
|
|
)
|
|
|
|
if(INODE_CACHE_SUPPORTED)
|
|
@@ -45,10 +46,11 @@ if(CCACHE_EXTRA_LIBS)
|
|
endif()
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
+find_package(fmt REQUIRED)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(
|
|
ccache_framework
|
|
- PRIVATE standard_settings standard_warnings ZSTD::ZSTD Threads::Threads third_party
|
|
+ PRIVATE standard_settings standard_warnings blake3 fmt::fmt ZSTD::ZSTD Threads::Threads PkgConfig::xxhash
|
|
)
|
|
|
|
target_include_directories(ccache_framework PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
@@ -57,7 +59,7 @@ if(REDIS_STORAGE_BACKEND)
|
|
target_compile_definitions(ccache_framework PUBLIC -DHAVE_REDIS_STORAGE_BACKEND)
|
|
target_link_libraries(
|
|
ccache_framework
|
|
- PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS third_party
|
|
+ PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS
|
|
)
|
|
endif()
|
|
|
|
diff -up ccache-4.9.1/src/hashutil.cpp.unbundle ccache-4.9.1/src/hashutil.cpp
|
|
--- ccache-4.9.1/src/hashutil.cpp.unbundle 2024-02-05 12:29:52.000000000 -0700
|
|
+++ ccache-4.9.1/src/hashutil.cpp 2024-02-08 08:24:25.200673484 -0700
|
|
@@ -37,7 +37,9 @@
|
|
# include "InodeCache.hpp"
|
|
#endif
|
|
|
|
-#include "third_party/blake3/blake3_cpu_supports_avx2.h"
|
|
+#ifdef HAVE_AVX2
|
|
+# include "third_party/blake3/blake3_cpu_supports_avx2.h"
|
|
+#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
# include <unistd.h>
|
|
diff -up ccache-4.9.1/src/third_party/CMakeLists.txt.unbundle ccache-4.9.1/src/third_party/CMakeLists.txt
|
|
--- ccache-4.9.1/src/third_party/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700
|
|
+++ ccache-4.9.1/src/third_party/CMakeLists.txt 2024-02-08 08:26:04.233417232 -0700
|
|
@@ -1,58 +1,59 @@
|
|
-add_library(third_party STATIC format.cpp httplib.cpp url.cpp xxhash.c)
|
|
-if(NOT MSVC)
|
|
- target_sources(third_party PRIVATE getopt_long.c)
|
|
-else()
|
|
- target_sources(third_party PRIVATE win32/getopt.c)
|
|
- target_compile_definitions(third_party PUBLIC -DSTATIC_GETOPT)
|
|
-endif()
|
|
+if(0)
|
|
+ add_library(third_party STATIC format.cpp httplib.cpp url.cpp xxhash.c)
|
|
+ if(NOT MSVC)
|
|
+ target_sources(third_party PRIVATE getopt_long.c)
|
|
+ else()
|
|
+ target_sources(third_party PRIVATE win32/getopt.c)
|
|
+ target_compile_definitions(third_party PUBLIC -DSTATIC_GETOPT)
|
|
+ endif()
|
|
+ file(GLOB headers *.h fmt/*.h nonstd/*.hpp)
|
|
+ target_sources(third_party PRIVATE ${headers})
|
|
+
|
|
+ set(xxhdispatchtest [=[
|
|
+ #include "xxh_x86dispatch.c"
|
|
+
|
|
+ int main()
|
|
+ {
|
|
+ XXH3_64bits_dispatch("foo", 3);
|
|
+ return 1;
|
|
+ }
|
|
+ ]=])
|
|
+
|
|
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" "${xxhdispatchtest}")
|
|
+
|
|
+ try_compile(USE_XXH_DISPATCH ${CMAKE_CURRENT_BINARY_DIR}
|
|
+ "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c"
|
|
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}"
|
|
+ COMPILE_DEFINITIONS "-DXXH_STATIC_LINKING_ONLY")
|
|
+
|
|
+ target_compile_definitions(third_party INTERFACE "-DXXH_STATIC_LINKING_ONLY")
|
|
+ if(USE_XXH_DISPATCH)
|
|
+ target_sources(third_party PRIVATE xxh_x86dispatch.c)
|
|
+ target_compile_definitions(third_party INTERFACE "-DUSE_XXH_DISPATCH")
|
|
+ endif()
|
|
+
|
|
+ # Treat third party headers as system files (no warning for those headers).
|
|
+ target_include_directories(
|
|
+ third_party
|
|
+ PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM
|
|
+ )
|
|
+
|
|
+ target_link_libraries(third_party PRIVATE standard_settings)
|
|
+endif ()
|
|
+
|
|
|
|
if(WIN32)
|
|
target_sources(third_party PRIVATE win32/mktemp.c)
|
|
+ file(GLOB headers win32/*.h)
|
|
+ target_sources(third_party PRIVATE ${headers})
|
|
+
|
|
+ target_link_libraries(third_party PRIVATE ws2_32)
|
|
endif ()
|
|
|
|
if(ENABLE_TRACING)
|
|
target_sources(third_party PRIVATE minitrace.c)
|
|
endif()
|
|
|
|
-file(GLOB headers *.h fmt/*.h nonstd/*.hpp win32/*.h)
|
|
-target_sources(third_party PRIVATE ${headers})
|
|
-
|
|
-set(xxhdispatchtest [=[
|
|
-#include "xxh_x86dispatch.c"
|
|
-
|
|
-int main()
|
|
-{
|
|
- XXH3_64bits_dispatch("foo", 3);
|
|
- return 1;
|
|
-}
|
|
-]=])
|
|
-
|
|
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c" "${xxhdispatchtest}")
|
|
-
|
|
-try_compile(USE_XXH_DISPATCH ${CMAKE_CURRENT_BINARY_DIR}
|
|
- "${CMAKE_CURRENT_BINARY_DIR}/xxhdispatchtest.c"
|
|
- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}"
|
|
- COMPILE_DEFINITIONS "-DXXH_STATIC_LINKING_ONLY")
|
|
-
|
|
-target_compile_definitions(third_party INTERFACE "-DXXH_STATIC_LINKING_ONLY")
|
|
-if(USE_XXH_DISPATCH)
|
|
- target_sources(third_party PRIVATE xxh_x86dispatch.c)
|
|
- target_compile_definitions(third_party INTERFACE "-DUSE_XXH_DISPATCH")
|
|
-endif()
|
|
-
|
|
-# Treat third party headers as system files (no warning for those headers).
|
|
-target_include_directories(
|
|
- third_party
|
|
- PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM
|
|
-)
|
|
-
|
|
-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)
|
|
-endif()
|
|
-
|
|
# Silence warning from winbase.h due to /Zc:preprocessor.
|
|
if(MSVC)
|
|
target_compile_options(third_party PRIVATE /wd5105)
|
|
diff -up ccache-4.9.1/unittest/CMakeLists.txt.unbundle ccache-4.9.1/unittest/CMakeLists.txt
|
|
--- ccache-4.9.1/unittest/CMakeLists.txt.unbundle 2024-02-05 12:29:52.000000000 -0700
|
|
+++ ccache-4.9.1/unittest/CMakeLists.txt 2024-02-08 08:24:25.196673454 -0700
|
|
@@ -59,7 +59,7 @@ endif()
|
|
|
|
target_link_libraries(
|
|
unittest
|
|
- PRIVATE standard_settings standard_warnings ccache_framework third_party)
|
|
+ PRIVATE standard_settings standard_warnings ccache_framework PkgConfig::xxhash)
|
|
|
|
target_include_directories(unittest PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${ccache_SOURCE_DIR}/src)
|
|
|