diff options
author | Eike Ziller <eike.ziller@qt.io> | 2022-05-11 11:53:47 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-05-17 11:55:26 +0000 |
commit | c311b8e0fa17ab62dbd076b3d8486f6a210c5a92 (patch) | |
tree | 5bebbbabb1b76389b35f58e5a03b4cb85b4d4a4d /src/plugins/clangformat | |
parent | d35b9547f834a2a64bc24d0acc810c7fe41d7593 (diff) |
ClangFormat: Ignore compiler warnings in clang-format headers
By making the include paths "system" includes.
Change-Id: Idf417195b921c2cd861efc24b814a30f5739eef5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/clangformat')
-rw-r--r-- | src/plugins/clangformat/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/clangformat/CMakeLists.txt b/src/plugins/clangformat/CMakeLists.txt index dbeaed9488..f2eff70c58 100644 --- a/src/plugins/clangformat/CMakeLists.txt +++ b/src/plugins/clangformat/CMakeLists.txt @@ -1,7 +1,6 @@ add_qtc_plugin(ClangFormat CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND (QTC_CLANG_BUILDMODE_MATCH OR CLANGTOOLING_LINK_CLANG_DYLIB) DEPENDS Utils Qt5::Widgets ${CLANG_FORMAT_LIB} - INCLUDES "${CLANG_INCLUDE_DIRS}" PLUGIN_DEPENDS Core TextEditor CppEditor ProjectExplorer SOURCES clangformatbaseindenter.cpp clangformatbaseindenter.h @@ -15,6 +14,11 @@ add_qtc_plugin(ClangFormat clangformatutils.cpp clangformatutils.h ) +if(TARGET ClangFormat) + # "system" includes, so warnings are ignored + target_include_directories(ClangFormat SYSTEM PRIVATE "${CLANG_INCLUDE_DIRS}") +endif() + if(MSVC AND TARGET ClangFormat) target_compile_options(ClangFormat PUBLIC /wd4267 /wd4624) endif() |