From 84ecf4b1dd48737572ffc5d2e6bc31577ccf8187 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 28 Jul 2015 18:32:41 +0300 Subject: [PATCH 1/2] Disabling precompiled headers when ccache is detected --- cmake/OpenCVDetectCXXCompiler.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index 49413467d0..7b670711d9 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -13,8 +13,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_CLANGCC 1) endif() +if("${CMAKE_CXX_COMPILER};${CMAKE_CXX_COMPILER}" MATCHES "ccache") + set(CMAKE_COMPILER_IS_CCACHE 1) +endif() -if((CMAKE_COMPILER_IS_CLANGCXX OR CMAKE_COMPILER_IS_CLANGCC) AND NOT CMAKE_GENERATOR MATCHES "Xcode") +if((CMAKE_COMPILER_IS_CLANGCXX OR CMAKE_COMPILER_IS_CLANGCC OR CMAKE_COMPILER_IS_CCACHE) AND NOT CMAKE_GENERATOR MATCHES "Xcode") set(ENABLE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE) endif() From 69db797ebbb8b095429621856963d16daa20843e Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 25 Aug 2015 18:24:07 +0300 Subject: [PATCH 2/2] Fixed ccache detection condition --- cmake/OpenCVDetectCXXCompiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index 7b670711d9..360a08fec1 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -13,7 +13,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_CLANGCC 1) endif() -if("${CMAKE_CXX_COMPILER};${CMAKE_CXX_COMPILER}" MATCHES "ccache") +if("${CMAKE_CXX_COMPILER};${CMAKE_C_COMPILER}" MATCHES "ccache") set(CMAKE_COMPILER_IS_CCACHE 1) endif()