From: Joel Rosdahl Date: Wed, 28 Jul 2021 18:15:10 +0000 (+0200) Subject: build: Remove “_lib” suffix from ccache_lib and third_party_lib X-Git-Tag: v4.4~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a48a63b13edcc6c912b4a4c85be96a7fb1985ec1;p=thirdparty%2Fccache.git build: Remove “_lib” suffix from ccache_lib and third_party_lib This means that libthird_party_lib.a will become libthird_party.a which removes repetition of “lib”. ccache_lib can’t be renamed to just ccache since that’s the name of the main binary, so that’s renamed to ccache_framework. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0673a4a3e..caed58756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,7 @@ add_subdirectory(src) # ccache executable # add_executable(ccache src/main.cpp) -target_link_libraries(ccache PRIVATE standard_settings standard_warnings ccache_lib) +target_link_libraries(ccache PRIVATE standard_settings standard_warnings ccache_framework) # # Documentation diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ace0cb5c..867aebada 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,40 +44,40 @@ if(WIN32) list(APPEND source_files Win32Util.cpp) endif() -add_library(ccache_lib STATIC ${source_files}) +add_library(ccache_framework STATIC ${source_files}) target_compile_definitions( - ccache_lib PUBLIC -Dnssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD + ccache_framework PUBLIC -Dnssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD ) if(WIN32) - target_link_libraries(ccache_lib PRIVATE ws2_32 "psapi") + target_link_libraries(ccache_framework PRIVATE ws2_32 "psapi") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") if(STATIC_LINK) - target_link_libraries(ccache_lib PRIVATE -static-libgcc -static-libstdc++ -static winpthread -dynamic) + target_link_libraries(ccache_framework PRIVATE -static-libgcc -static-libstdc++ -static winpthread -dynamic) else() - target_link_libraries(ccache_lib PRIVATE winpthread) + target_link_libraries(ccache_framework PRIVATE winpthread) endif() elseif(STATIC_LINK AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_link_libraries(ccache_lib PRIVATE -static c++ -dynamic) + target_link_libraries(ccache_framework PRIVATE -static c++ -dynamic) endif() endif() set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) target_link_libraries( - ccache_lib - PRIVATE standard_settings standard_warnings ZSTD::ZSTD - Threads::Threads third_party_lib) + ccache_framework + PRIVATE standard_settings standard_warnings ZSTD::ZSTD Threads::Threads third_party +) -target_include_directories(ccache_lib PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(ccache_framework PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) if(REDIS_STORAGE_BACKEND) - target_compile_definitions(ccache_lib PRIVATE -DHAVE_REDIS_STORAGE_BACKEND) + target_compile_definitions(ccache_framework PRIVATE -DHAVE_REDIS_STORAGE_BACKEND) target_link_libraries( - ccache_lib - PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS - third_party_lib) + ccache_framework + PUBLIC standard_settings standard_warnings HIREDIS::HIREDIS third_party + ) endif() add_subdirectory(compression) diff --git a/src/compression/CMakeLists.txt b/src/compression/CMakeLists.txt index 50ceb2c00..042a0b442 100644 --- a/src/compression/CMakeLists.txt +++ b/src/compression/CMakeLists.txt @@ -9,4 +9,4 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/types.cpp ) -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a00797514..60d42973b 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -6,4 +6,4 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/mainoptions.cpp ) -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/CMakeLists.txt b/src/storage/CMakeLists.txt index 65f7d898e..c107e8e18 100644 --- a/src/storage/CMakeLists.txt +++ b/src/storage/CMakeLists.txt @@ -6,4 +6,4 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/Storage.cpp ) -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/primary/CMakeLists.txt b/src/storage/primary/CMakeLists.txt index 04a565e38..ab6ee4a6d 100644 --- a/src/storage/primary/CMakeLists.txt +++ b/src/storage/primary/CMakeLists.txt @@ -9,4 +9,4 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/util.cpp ) -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/storage/secondary/CMakeLists.txt b/src/storage/secondary/CMakeLists.txt index c5f57985a..0ea75515c 100644 --- a/src/storage/secondary/CMakeLists.txt +++ b/src/storage/secondary/CMakeLists.txt @@ -9,4 +9,4 @@ if(REDIS_STORAGE_BACKEND) list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/RedisStorage.cpp) endif() -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index 3a06ee276..b20fb4ccd 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -1,17 +1,17 @@ -add_library(third_party_lib STATIC base32hex.c format.cpp url.cpp xxhash.c) +add_library(third_party STATIC base32hex.c format.cpp url.cpp xxhash.c) if(NOT MSVC) - target_sources(third_party_lib PRIVATE getopt_long.c) + target_sources(third_party PRIVATE getopt_long.c) else() - target_sources(third_party_lib PRIVATE win32/getopt.c) - target_compile_definitions(third_party_lib PUBLIC -DSTATIC_GETOPT) + target_sources(third_party PRIVATE win32/getopt.c) + target_compile_definitions(third_party PUBLIC -DSTATIC_GETOPT) endif() if(WIN32) - target_sources(third_party_lib PRIVATE win32/mktemp.c) + target_sources(third_party PRIVATE win32/mktemp.c) endif () if(ENABLE_TRACING) - target_sources(third_party_lib PRIVATE minitrace.c) + target_sources(third_party PRIVATE minitrace.c) endif() set(xxhdispatchtest [=[ @@ -31,25 +31,24 @@ try_compile(USE_XXH_DISPATCH ${CMAKE_CURRENT_BINARY_DIR} CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}" COMPILE_DEFINITIONS "-DXXH_STATIC_LINKING_ONLY") -target_compile_definitions(third_party_lib INTERFACE "-DXXH_STATIC_LINKING_ONLY") +target_compile_definitions(third_party INTERFACE "-DXXH_STATIC_LINKING_ONLY") if(USE_XXH_DISPATCH) - target_sources(third_party_lib PRIVATE xxh_x86dispatch.c) - target_compile_definitions(third_party_lib INTERFACE "-DUSE_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_lib - PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM) + third_party + PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} SYSTEM +) -target_link_libraries(third_party_lib PRIVATE standard_settings) -target_link_libraries(third_party_lib INTERFACE blake3) +target_link_libraries(third_party PRIVATE standard_settings) +target_link_libraries(third_party INTERFACE blake3) # Silence warning from winbase.h due to /Zc:preprocessor. if(MSVC) - target_compile_options( - third_party_lib - PRIVATE /wd5105) + target_compile_options(third_party PRIVATE /wd5105) endif() add_subdirectory(blake3) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 48e96ae62..0685ad992 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -7,4 +7,4 @@ set( ${CMAKE_CURRENT_SOURCE_DIR}/string.cpp ) -target_sources(ccache_lib PRIVATE ${sources}) +target_sources(ccache_framework PRIVATE ${sources}) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index d30902084..f8711a102 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -43,7 +43,7 @@ add_executable(unittest ${source_files}) target_link_libraries( unittest - PRIVATE standard_settings standard_warnings ccache_lib third_party_lib) + PRIVATE standard_settings standard_warnings ccache_framework third_party) target_include_directories(unittest PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${ccache_SOURCE_DIR}/src)