Merge pull request #7191 from GerbilSoft/feature/ar-thin-archives

CMake: Use thin archives on Linux.
This commit is contained in:
Markus Wick 2018-07-03 10:22:02 +02:00 committed by GitHub
commit 4b1b713e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -48,7 +48,7 @@ option(OPROFILING "Enable profiling" OFF)
option(DSPTOOL "Build dsptool" OFF) option(DSPTOOL "Build dsptool" OFF)
# Enable SDL for default on operating systems that aren't OSX, Android, Linux or Windows. # Enable SDL for default on operating systems that aren't OSX, Android, Linux or Windows.
if(NOT APPLE AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT MSVC) if(NOT APPLE AND NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT MSVC)
option(ENABLE_SDL "Enables SDL as a generic controller backend" ON) option(ENABLE_SDL "Enables SDL as a generic controller backend" ON)
else() else()
option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF) option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF)
@ -59,7 +59,7 @@ if(APPLE)
option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF) option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF)
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(ENABLE_VTUNE "Enable Intel VTune integration for JIT code." OFF) option(ENABLE_VTUNE "Enable Intel VTune integration for JIT code." OFF)
if(NOT ANDROID) if(NOT ANDROID)
@ -259,6 +259,15 @@ else()
dolphin_compile_definitions(_DEBUG DEBUG_ONLY) dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
check_and_add_flag(GGDB -ggdb DEBUG_ONLY) check_and_add_flag(GGDB -ggdb DEBUG_ONLY)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# GNU ar: Create thin archive files.
# Requires binutils-2.19 or later.
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(CMAKE_SYSTEM_NAME MATCHES "Darwin")

View File

@ -142,7 +142,7 @@ elseif(USE_X11)
target_link_libraries(common PUBLIC ${XRANDR_LIBRARIES}) target_link_libraries(common PUBLIC ${XRANDR_LIBRARIES})
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(common PUBLIC dl rt) target_link_libraries(common PUBLIC dl rt)
endif() endif()