Merge pull request #2684 from firewave/precompiled

use precompiled headers if CMake supports it
This commit is contained in:
Daniel Marjamäki 2020-06-17 07:53:51 +02:00 committed by GitHub
commit 94f92f00fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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(