Skip to content

Commit dae37f1

Browse files
authored
disabled precompiled headers in CMake as they currently do not emit any compiler warnings / adjusted check for precompiled header (cppcheck-opensource#2820)
1 parent d9eacae commit dae37f1

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

cmake/options.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ option(WITH_QCHART "When building GUI(need BUILD_GUI=ON), use Qt5 Chart
4141
option(HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF)
4242
option(USE_Z3 "Usage of z3 library" OFF)
4343

44-
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
45-
set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
46-
else()
44+
# precompiled headers do not emit compiler warnings so we cannot use them right now
45+
#if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
46+
# set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers")
47+
#else()
4748
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers")
48-
endif()
49+
#endif()
4950

5051
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
5152
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (BUILD_TESTS)
2727
target_link_libraries(testrunner ${Z3_LIBRARIES})
2828
endif()
2929

30-
if (CMAKE_VERSION VERSION_EQUAL "3.16" OR CMAKE_VERSION VERSION_GREATER "3.16")
30+
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
3131
target_precompile_headers(testrunner PRIVATE precompiled.h)
3232
endif()
3333

0 commit comments

Comments
 (0)