From f98cd210abb40e487b30952db25c97e28726dbb4 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: 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(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f18239edb..9d0af02fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,6 +77,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) -- cgit v1.2.3