diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 905972d11e0..152d0c05686 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -142,7 +142,7 @@ else() add_definitions(-D_WINKD_=1) endif() - if(CMAKE_VERSION STREQUAL "2.8.12.1-ReactOS" AND NOT ENABLE_CCACHE) + if(CMAKE_VERSION STREQUAL "2.8.12.1-ReactOS") set(PCH 1 CACHE BOOL "Whether to use precompiled headers") else() set(PCH 0 CACHE BOOL "Whether to use precompiled headers") diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 45c38009e3d..8117cf3f401 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -366,7 +366,7 @@ endmacro() set(PSEH_LIB "pseh") # Macros -if(PCH) +if(PCH AND (NOT ENABLE_CCACHE)) add_compile_flags("-Winvalid-pch -Werror=invalid-pch") macro(add_pch _target _pch _sources) # When including x.h GCC looks for x.h.gch first @@ -388,10 +388,6 @@ if(PCH) EXTERNAL_SOURCE TRUE OBJECT_LOCATION ${_gch}) - if(ENABLE_CCACHE) - set(_ccache_flag "-fpch-preprocess") - endif() - # Include the gch in the specified source files, skipping the pch file itself list(REMOVE_ITEM ${_sources} ${_pch}) foreach(_src ${${_sources}})