File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -89,3 +89,14 @@ if (PXR_PREFER_SAFETY_OVER_SPEED)
8989else ()
9090 set (PXR_PREFER_SAFETY_OVER_SPEED "0" )
9191endif ()
92+
93+ # Setup CCache for C/C++ compilation
94+ if (PXR_ENABLE_COMPILER_CACHE)
95+ find_program (COMPILER_CACHE_PROGRAM ${PXR_COMPILER_CACHE_NAME} )
96+ if (COMPILER_CACHE_PROGRAM)
97+ set (CMAKE_C_COMPILER_LAUNCHER "${COMPILER_CACHE_PROGRAM} " )
98+ set (CMAKE_CXX_COMPILER_LAUNCHER "${COMPILER_CACHE_PROGRAM} " )
99+ else ()
100+ MESSAGE (STATUS "Compiler Caching disabled. Could not find ${PXR_COMPILER_CACHE_NAME} ." )
101+ endif ()
102+ endif ()
Original file line number Diff line number Diff line change @@ -231,3 +231,11 @@ if (${PXR_BUILD_PYTHON_DOCUMENTATION})
231231 set (PXR_BUILD_PYTHON_DOCUMENTATION "OFF" CACHE BOOL "" FORCE)
232232 endif ()
233233endif ()
234+
235+ # Configure the use of compiler caches for faster compilation
236+ option (PXR_ENABLE_COMPILER_CACHE "Enable the use of a compiler cache" OFF )
237+ set (PXR_COMPILER_CACHE_NAME "ccache"
238+ CACHE
239+ STRING
240+ "The name of the compiler cache program to use"
241+ )
You can’t perform that action at this time.
0 commit comments