From dae37f1c9fe50e29a58c5c2928368ed0d45b624f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 23 Sep 2020 07:51:21 +0200 Subject: [PATCH] disabled precompiled headers in CMake as they currently do not emit any compiler warnings / adjusted check for precompiled header (#2820) --- cmake/options.cmake | 9 +++++---- test/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 3b5506518..179c9ccc1 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -41,11 +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() +# precompiled headers do not emit compiler warnings so we cannot use them right now +#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() +#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") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0740b6d28..84f8a638f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -27,7 +27,7 @@ if (BUILD_TESTS) target_link_libraries(testrunner ${Z3_LIBRARIES}) endif() - if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16") + if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) target_precompile_headers(testrunner PRIVATE precompiled.h) endif()