Skip to content

Commit

Permalink
[FIXUP] Rename CCACHE_EXECUTABLE --> CCACHE_COMMAND for consistency
Browse files Browse the repository at this point in the history
Other cases:
- CMAKE_COMMAND
- PYTHON_COMMAND
- BREW_COMMAND
  • Loading branch information
hebasto committed Jul 13, 2023
1 parent 0476509 commit ac7bc5b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmake/optional.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# Optional features and packages.

if(CCACHE)
find_program(CCACHE_EXECUTABLE ccache)
if(CCACHE_EXECUTABLE)
find_program(CCACHE_COMMAND ccache)
if(CCACHE_COMMAND)
if(MSVC)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
# ccache >= 4.8 requires compile batching turned off that is available since CMake 3.24.
# See https://github.com/ccache/ccache/wiki/MS-Visual-Studio
set(CCACHE ON)
set(MSVC_CCACHE_WRAPPER_CONTENT "\"${CCACHE_EXECUTABLE}\" \"${CMAKE_CXX_COMPILER}\"")
set(MSVC_CCACHE_WRAPPER_CONTENT "\"${CCACHE_COMMAND}\" \"${CMAKE_CXX_COMPILER}\"")
set(MSVC_CCACHE_WRAPPER_FILENAME wrapped-cl.bat)
file(WRITE ${CMAKE_BINARY_DIR}/${MSVC_CCACHE_WRAPPER_FILENAME} "${MSVC_CCACHE_WRAPPER_CONTENT} %*")
list(APPEND CMAKE_VS_GLOBALS
Expand All @@ -30,15 +30,15 @@ if(CCACHE)
endif()
else()
set(CCACHE ON)
list(APPEND CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE})
list(APPEND CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE})
list(APPEND CMAKE_C_COMPILER_LAUNCHER ${CCACHE_COMMAND})
list(APPEND CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_COMMAND})
endif()
elseif(CCACHE STREQUAL "AUTO")
set(CCACHE OFF)
else()
message(FATAL_ERROR "ccache requested, but not found.")
endif()
mark_as_advanced(CCACHE_EXECUTABLE)
mark_as_advanced(CCACHE_COMMAND)
endif()

if(WITH_NATPMP)
Expand Down

0 comments on commit ac7bc5b

Please sign in to comment.