diff options
author | Clemens Wasser <clemens.wasser@gmail.com> | 2023-06-17 11:05:27 (GMT) |
---|---|---|
committer | Clemens Wasser <clemens.wasser@gmail.com> | 2023-06-22 16:11:45 (GMT) |
commit | 17b16696d4c5cc26ed956848f7d5e9fe59a09c0a (patch) | |
tree | 4ba5badabbfb8fa176a8b589e2c4cccf20d34267 /CMakeLists.txt | |
parent | b928f52983e0aa28349b9b1f51fc574a34dfddf6 (diff) | |
download | CMake-17b16696d4c5cc26ed956848f7d5e9fe59a09c0a.zip CMake-17b16696d4c5cc26ed956848f7d5e9fe59a09c0a.tar.gz CMake-17b16696d4c5cc26ed956848f7d5e9fe59a09c0a.tar.bz2 |
CMake: Add CMake_BUILD_PCH option
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c1d50ca..2823ca4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,8 @@ if(CMake_BUILD_LTO) endif() endif() +option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF) + # Check whether to build support for the debugger mode. if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT DEFINED CMake_ENABLE_DEBUGGER) @@ -153,7 +155,6 @@ endif() # simply to improve readability of the main script #----------------------------------------------------------------------- macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) - # Options have dependencies. include(CMakeDependentOption) # Allow the user to enable/disable all system utility library options by @@ -324,6 +325,9 @@ configure_file(.clang-tidy .clang-tidy COPYONLY) option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) if(CMake_RUN_IWYU) + if(CMake_BUILD_PCH) + message(FATAL_ERROR "CMake_RUN_IWYU and CMake_BUILD_PCH are ON, but they are incompatible!") + endif() find_program(IWYU_COMMAND NAMES include-what-you-use iwyu) if(NOT IWYU_COMMAND) message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") |