Skip to content

Commit

Permalink
build: added support for ccache
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Jenikovsky <[email protected]>
  • Loading branch information
jendo42 committed Jul 8, 2024
1 parent 8ac80bc commit 6ec99b5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ release-samples:
cp -f Makefile.iopglobal_sample $(SAMPLES_TARGET)/Makefile.iopglobal
cp -f ps2dev.cmake $(SHARE_TARGET)/ps2dev.cmake
cp -f ps2dev_iop.cmake $(SHARE_TARGET)/ps2dev_iop.cmake
cp -f ccache.cmake $(SHARE_TARGET)/ccache.cmake

release-clean:
rm -f -r $(SAMPLES_TARGET)
Expand Down
10 changes: 10 additions & 0 deletions samples/ccache.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
find_program(CCACHE_FOUND "ccache")
set(CCACHE_SUPPORT ON CACHE BOOL "Enable ccache support")
if (CCACHE_FOUND AND CCACHE_SUPPORT)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# without this compiler messages in `make` backend would be uncolored
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=auto")
endif()
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "ccache")
endif(CCACHE_FOUND AND CCACHE_SUPPORT)
2 changes: 2 additions & 0 deletions samples/ps2dev.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-nostartfiles -Wl,-r -Wl,-d")
SET(PS2 TRUE)
SET(PLATFORM_PS2 TRUE)
SET(EE TRUE)

INCLUDE(${PS2DEV}/share/ccache.cmake)
2 changes: 2 additions & 0 deletions samples/ps2dev_iop.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ ENDFUNCTION()
SET(PLATFORM_PS2 TRUE)
SET(IOP TRUE)
SET(PS2 TRUE)

INCLUDE(${PS2DEV}/share/ccache.cmake)

0 comments on commit 6ec99b5

Please sign in to comment.