mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-22 19:15:29 +00:00
CMake: Add option to use Ccache.
This commit is contained in:
parent
5e61f245ab
commit
a71ad40ac3
|
@ -513,6 +513,7 @@ dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" O
|
|||
dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF)
|
||||
set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF)
|
||||
option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "")
|
||||
set_option(SDL_CCACHE "Use Ccache to speed up build" ON)
|
||||
|
||||
option(SDL_WERROR "Enable -Werror" OFF)
|
||||
|
||||
|
@ -3113,6 +3114,19 @@ if (SDL_ASAN)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_CCACHE)
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
find_program(CCACHE_BINARY ccache)
|
||||
if(CCACHE_BINARY)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
||||
set(CMAKE_OBJC_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
||||
set(HAVE_CCACHE ON)
|
||||
else()
|
||||
set(HAVE_CCACHE OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_TESTS)
|
||||
set(HAVE_TESTS ON)
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue