[cmake] USE_CCACHE option #349

Closed
DraVee wants to merge 4 commits from DraVee:old/windows-cache into master
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 1a1e12370c - Show all commits

View file

@ -263,7 +263,6 @@ if(USE_CCACHE)
message(STATUS "Found ccache at: ${CCACHE_BINARY}") message(STATUS "Found ccache at: ${CCACHE_BINARY}")
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY}) set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY}) set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY})
set(CMAKE_OBJC_COMPILER_LAUNCHER ${CCACHE_BINARY})
if(WIN32) if(WIN32)
message(WARNING "USE_CCACHE is unstable under Windows, errors may occur...") message(WARNING "USE_CCACHE is unstable under Windows, errors may occur...")
# we need to downgrade debug info (/Zi -> /Z7) to use an older but more cacheable format # we need to downgrade debug info (/Zi -> /Z7) to use an older but more cacheable format
@ -271,6 +270,9 @@ if(USE_CCACHE)
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif() endif()
if (YUZU_USE_PRECOMPILED_HEADERS)
message(WARNING "YUZU_USE_PRECOMPILED_HEADERS reduce the number of USE_CCACHE files, consider disabling...")
endif()
else() else()
message(WARNING "USE_CCACHE enabled, but no executable found at: ${CCACHE_PATH}") message(WARNING "USE_CCACHE enabled, but no executable found at: ${CCACHE_PATH}")
endif() endif()

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project # SPDX-FileCopyrightText: 2022 yuzu Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later