From 72a081c61775deb06034f5b7e922f7e6246178af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 30 Jun 2019 13:29:52 +0200 Subject: [PATCH] CMake: Create thin archives on Linux This significantly reduces unnecessary disk writes and space usage when building Citra. libcore.a is now only ~1MB rather than several hundred megabytes. --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 663a9493f..4a4c39f17 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,6 +80,15 @@ else() add_compile_options("-static") endif() endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW) + # GNU ar: Create thin archive files. + # Requires binutils-2.19 or later. + set(CMAKE_C_ARCHIVE_CREATE " qcTP ") + set(CMAKE_C_ARCHIVE_APPEND " qTP ") + set(CMAKE_CXX_ARCHIVE_CREATE " qcTP ") + set(CMAKE_CXX_ARCHIVE_APPEND " qTP ") + endif() endif() add_subdirectory(common)