File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,6 +90,17 @@ else()
9090 set (PXR_PREFER_SAFETY_OVER_SPEED "0" )
9191endif ()
9292
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 ()
103+
93104# Set that Apple Framework is being build
94105if (PXR_BUILD_APPLE_FRAMEWORK)
95106 _add_define ("PXR_BUILD_APPLE_FRAMEWORK" )
Original file line number Diff line number Diff line change @@ -245,3 +245,11 @@ if (${PXR_BUILD_PYTHON_DOCUMENTATION})
245245 set (PXR_BUILD_PYTHON_DOCUMENTATION "OFF" CACHE BOOL "" FORCE )
246246 endif ()
247247endif ()
248+
249+ # Configure the use of compiler caches for faster compilation
250+ option (PXR_ENABLE_COMPILER_CACHE "Enable the use of a compiler cache" OFF )
251+ set (PXR_COMPILER_CACHE_NAME "ccache"
252+ CACHE
253+ STRING
254+ "The name of the compiler cache program to use"
255+ )
You can’t perform that action at this time.
0 commit comments