]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Reduce duplication in third party CMakeLists.txt
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 20 Sep 2020 20:27:47 +0000 (22:27 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 23 Sep 2020 07:41:38 +0000 (09:41 +0200)
src/third_party/CMakeLists.txt

index 6b0e605357e7107fae932bcbce512b5335bcaf8a..d4876cdaa9ef3caa56a04720d689039d62e0f7b7 100644 (file)
@@ -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()