Merge pull request #2694 from pfultz2/pch
Add option to disable pch since its broken with ccache
This commit is contained in:
commit
f569bc79f5
|
@ -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(HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF)
|
||||||
option(USE_Z3 "Usage of z3 library" 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_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")
|
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ message( STATUS "Compiler = ${CMAKE_CXX_COMPILER_ID}")
|
||||||
message( STATUS "Compiler Version = ${CMAKE_CXX_COMPILER_VERSION}")
|
message( STATUS "Compiler Version = ${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
message( STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
message( STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
||||||
message( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
|
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 (General) = ${CMAKE_CXX_FLAGS}")
|
||||||
message( STATUS "C++ flags (Release) = ${CMAKE_CXX_FLAGS_RELEASE}")
|
message( STATUS "C++ flags (Release) = ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
message( STATUS "C++ flags (RelWithDebInfo) = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
message( STATUS "C++ flags (RelWithDebInfo) = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||||
|
|
|
@ -37,13 +37,13 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(lib_objs OBJECT ${srcs_lib} ${hdrs})
|
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)
|
target_precompile_headers(lib_objs PRIVATE precompiled.h)
|
||||||
endif()
|
endif()
|
||||||
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
add_library(lib_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs_lib} ${hdrs})
|
add_library(lib_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs_lib} ${hdrs})
|
||||||
target_compile_options(lib_objs_sanitized PRIVATE -fsanitize=address)
|
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)
|
target_precompile_headers(lib_objs_sanitized PRIVATE precompiled.h)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue