Skip to content

Commit

Permalink
Undo #8262 (#8288)
Browse files Browse the repository at this point in the history
Compile cache wrappers have been fixed to handle CMake generating
dependencies as in 3.20:

New in version 3.20.
For the Makefile Generators, source dependencies are now, for a
selection of compilers, generated by the compiler itself. By
defining this variable with value FALSE, you can restore the
legacy behavior (i.e. using CMake for dependencies discovery).

Signed-off-by: Soren Soe <[email protected]>
  • Loading branch information
stsoe authored Jul 11, 2024
1 parent 8bbe208 commit 5b0b4d1
Showing 1 changed file with 17 additions and 33 deletions.
50 changes: 17 additions & 33 deletions src/CMake/ccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,25 @@
#
if (RDI_CCACHE)

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20.0")
message ("-- CCACHE doesn't work with CMake version >= 3.20.0")
else()
find_program(gccwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccwrap)
find_program(gccarwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccarwrap)

find_program(gccwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccwrap)
find_program(gccarwrap /tools/batonroot/rodin/devkits/lnx64/ccwrap/gccarwrap)

if (gccwrap)
message ("-- Using compile cache wrapper ${gccwrap} with cache in $ENV{RDI_CCACHEROOT}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${gccwrap} --with-cache-rw")
endif ()
if (gccwrap)
message ("-- Using compile cache wrapper ${gccwrap} with cache in $ENV{RDI_CCACHEROOT}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${gccwrap} --with-cache-rw")
endif ()

if (gccarwrap)
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH)
set(CMAKE_C_ARCHIVE_FINISH)
message ("-- Using link cache wrapper ${gccarwrap} with cache in $ENV{RDI_CCACHEROOT}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${gccarwrap} --with-cache-rw")
endif ()
if (gccarwrap)
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -qc -o <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_FINISH)
set(CMAKE_C_ARCHIVE_FINISH)
message ("-- Using link cache wrapper ${gccarwrap} with cache in $ENV{RDI_CCACHEROOT}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${gccarwrap} --with-cache-rw")
endif ()

# Disable abi compile time checks which renders ccache close to useless
message ("***** CCACHE: DISABLING ABI VERSION CHECK ******")
add_compile_options("-DDISABLE_ABI_CHECK")

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20.0")
# New in version 3.20.
# For the Makefile Generators, source dependencies are now, for a
# selection of compilers, generated by the compiler itself. By
# defining this variable with value FALSE, you can restore the
# legacy behavior (i.e. using CMake for dependencies discovery).
# Apparently doesn't work.
set(CMAKE_DEPENDS_USE_COMPILER FALSE)
endif()

endif()
# Disable abi compile time checks which renders ccache close to useless
message ("***** CCACHE: DISABLING ABI VERSION CHECK ******")
add_compile_options("-DDISABLE_ABI_CHECK")

endif()

0 comments on commit 5b0b4d1

Please sign in to comment.