From 9ce6f76a27d0c1a42d1d16805913850352ae804f Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 20 Sep 2020 22:27:47 +0200 Subject: [PATCH] Reduce duplication in third party CMakeLists.txt --- src/third_party/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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() -- 2.47.3