diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 088826c96..8061061f1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e3af00370..0740b6d28 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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(