diff options
author | Ray Molenkamp <github@lazydodo.com> | 2022-01-13 19:47:14 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2022-01-13 19:47:14 +0300 |
commit | 743b9c5e1d9e9d23b8f51fd6778db8292de204ae (patch) | |
tree | 7d8187e50f10a1e43988e56da1d1c276b4e6df6a /source/CMakeLists.txt | |
parent | b8157f5bf13ceb2fd69295be14d13ddf72e12efd (diff) |
CMake: fix build issue with gcc+clang-tidy
Precompiled headers are in a compiler specific format,
when using clang-tidy it tries to read the GCC PCH file
and fails at that.
Disable PCH's for now when WITH_CLANG_TIDY is enabled since
a clean work-around doesn't seem readily available.
relevant LLVM/CMake bugs:
https://bugs.llvm.org/show_bug.cgi?id=41579
https://gitlab.kitware.com/cmake/cmake/-/issues/22081
Differential Revision: https://developer.blender.org/D13814
Reviewed by: sergey, Blendify
Diffstat (limited to 'source/CMakeLists.txt')
-rw-r--r-- | source/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0ce2341fc2e..6c2cbb5df33 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -25,6 +25,10 @@ endif() if(WITH_CLANG_TIDY AND NOT MSVC) if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang") message(WARNING "Currently Clang-Tidy might fail with GCC toolchain, switch to Clang toolchain if that happens") + if(COMMAND target_precompile_headers) + message(STATUS "Clang-Tidy and GCC precompiled headers are incompatible, disabling precompiled headers") + set(CMAKE_DISABLE_PRECOMPILE_HEADERS On) + endif() endif() find_package(ClangTidy REQUIRED) |