use precompiled headers if CMake supports it

This commit is contained in:
firewave 2020-06-16 19:55:15 +02:00
parent d984d84450
commit a49d60f0b3
2 changed files with 10 additions and 0 deletions

View File

@ -37,7 +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")
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")
target_precompile_headers(lib_objs_sanitized PRIVATE precompiled.h)
endif()
endif()

View File

@ -27,6 +27,10 @@ if (BUILD_TESTS)
target_link_libraries(testrunner ${Z3_LIBRARIES})
endif()
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
target_precompile_headers(testrunner PRIVATE precompiled.h)
endif()
add_custom_target(copy_cfg ALL
COMMENT "Copying cfg files")
add_custom_command(