mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-07-11 02:14:43 -06:00
cmake: Add USE_CCACHE option
self explanatory Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
fbeb53c25f
commit
34b7c08c19
@ -225,14 +225,15 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
|
||||
DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks)
|
||||
endif()
|
||||
|
||||
# Use ccache for android if available
|
||||
# Use ccache if the user requests it, or if NDK_CCACHE is set on Android
|
||||
# =======================================================================
|
||||
if (NOT $ENV{NDK_CCACHE} EQUAL "")
|
||||
set(CCACHE_EXE $ENV{NDK_CCACHE})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||
if ($ENV{NDK_CCACHE})
|
||||
set(USE_CCACHE ON)
|
||||
set(CCACHE_PATH $ENV{NDK_CCACHE})
|
||||
endif()
|
||||
|
||||
include(UseCcache)
|
||||
|
||||
# Check for LTO support
|
||||
# =======================================================================
|
||||
if (ENABLE_LTO)
|
||||
|
||||
16
CMakeModules/UseCcache.cmake
Normal file
16
CMakeModules/UseCcache.cmake
Normal file
@ -0,0 +1,16 @@
|
||||
# Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
# Licensed under GPLv2 or any later version
|
||||
# Refer to the license.txt file included.
|
||||
|
||||
option(USE_CCACHE "Use ccache to speed up subsequent builds" OFF)
|
||||
set(CCACHE_PATH "ccache" CACHE STRING "Path/name of an installed ccache binary")
|
||||
if (USE_CCACHE)
|
||||
find_program(CCACHE_EXE ${CCACHE_PATH})
|
||||
if (CCACHE_EXE)
|
||||
message(STATUS "CCache found at: ${CCACHE_EXE}")
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||
else()
|
||||
message(FATAL_ERROR "USE_CCACHE enabled, but no ccache found at ${CCACHE_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
Loading…
Reference in New Issue
Block a user