diff --git a/CMakeLists.txt b/CMakeLists.txt index 48fcde92a..7d2e1e203 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds (Windows only)" OFF) option(IMHEX_REPLACE_DWARF_WITH_PDB "Remove DWARF information from binaries when generating PDBS (Windows only)" OFF) option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF) +option(IMHEX_ENABLE_UNIT_TESTS "Enable building unit tests" OFF) +option(IMHEX_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers" OFF) # Basic compiler and cmake configurations set(CMAKE_CXX_STANDARD 23) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index a3a61beb2..a43412ada 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -764,6 +764,10 @@ function(addIncludesFromLibrary target library) endfunction() function(precompileHeaders target includeFolder) + if (NOT IMHEX_ENABLE_PRECOMPILED_HEADERS) + return() + endif() + file(GLOB_RECURSE TARGET_INCLUDES "${includeFolder}/**/*.hpp") set(SYSTEM_INCLUDES ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;") set(INCLUDES "${SYSTEM_INCLUDES};${TARGET_INCLUDES}")