Эх сурвалжийг харах

cmake: Fix ccache detection and cache result between runs

PatTheMav 3 жил өмнө
parent
commit
1d60c5322b

+ 15 - 5
cmake/ObsPluginHelpers.cmake

@@ -107,11 +107,21 @@ if(OS_POSIX)
       CACHE BOOL "Enable ccache support")
   mark_as_advanced(CCACHE_PROGRAM)
   if(CCACHE_PROGRAM AND CCACHE_SUPPORT)
-    set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
-    set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
-    set(CMAKE_OBJC_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
-    set(CMAKE_OBJCXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
-    set(CMAKE_CUDA_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) # CMake 3.9+
+    set(CMAKE_CXX_COMPILER_LAUNCHER
+        ${CCACHE_PROGRAM}
+        CACHE INTERNAL "")
+    set(CMAKE_C_COMPILER_LAUNCHER
+        ${CCACHE_PROGRAM}
+        CACHE INTERNAL "")
+    set(CMAKE_OBJC_COMPILER_LAUNCHER
+        ${CCACHE_PROGRAM}
+        CACHE INTERNAL "")
+    set(CMAKE_OBJCXX_COMPILER_LAUNCHER
+        ${CCACHE_PROGRAM}
+        CACHE INTERNAL "")
+    set(CMAKE_CUDA_COMPILER_LAUNCHER
+        ${CCACHE_PROGRAM}
+        CACHE INTERNAL "") # CMake 3.9+
   endif()
 endif()