Add option to disable pch since its broken with ccache

This commit is contained in:
Paul 2020-06-24 18:41:16 -05:00
parent c21b5b1aa4
commit 18a8b5bc65
3 changed files with 9 additions and 2 deletions

View File

@ -41,6 +41,12 @@ option(WITH_QCHART "When building GUI(need BUILD_GUI=ON), use Qt5 Chart
option(HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF)
option(USE_Z3 "Usage of z3 library" OFF)
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
else()
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers")
endif()
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")

View File

@ -5,6 +5,7 @@ message( STATUS "Compiler = ${CMAKE_CXX_COMPILER_ID}")
message( STATUS "Compiler Version = ${CMAKE_CXX_COMPILER_VERSION}")
message( STATUS "Build type = ${CMAKE_BUILD_TYPE}")
message( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
message( STATUS "CMAKE_DISABLE_PRECOMPILE_HEADERS = ${CMAKE_DISABLE_PRECOMPILE_HEADERS}" )
message( STATUS "C++ flags (General) = ${CMAKE_CXX_FLAGS}")
message( STATUS "C++ flags (Release) = ${CMAKE_CXX_FLAGS_RELEASE}")
message( STATUS "C++ flags (RelWithDebInfo) = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")

View File

@ -37,13 +37,13 @@ else()
endif()
add_library(lib_objs OBJECT ${srcs_lib} ${hdrs})
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
target_precompile_headers(lib_objs PRIVATE precompiled.h)
endif()
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_library(lib_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs_lib} ${hdrs})
target_compile_options(lib_objs_sanitized PRIVATE -fsanitize=address)
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
target_precompile_headers(lib_objs_sanitized PRIVATE precompiled.h)
endif()
endif()