From: Joel Rosdahl Date: Sun, 20 Sep 2020 20:27:47 +0000 (+0200) Subject: Reduce duplication in third party CMakeLists.txt X-Git-Tag: v4.0~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ce6f76a27d0c1a42d1d16805913850352ae804f;p=thirdparty%2Fccache.git Reduce duplication in third party CMakeLists.txt --- diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt index 6b0e60535..d4876cdaa 100644 --- a/src/third_party/CMakeLists.txt +++ b/src/third_party/CMakeLists.txt @@ -1,11 +1,14 @@ +set(third_party_source_files format.cpp xxhash.c) + if(NOT MSVC) - add_library(third_party_lib STATIC format.cpp getopt_long.c xxhash.c) + list(APPEND third_party_source_files getopt_long.c) else() - add_library(third_party_lib STATIC format.cpp win32/getopt.c xxhash.c) - + list(APPEND third_party_source_files win32/getopt.c) target_compile_definitions(third_party_lib PUBLIC -DSTATIC_GETOPT) endif() +add_library(third_party_lib STATIC ${third_party_source_files}) + if(ENABLE_TRACING) target_sources(third_party_lib PRIVATE minitrace.c) endif()