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>
This commit is contained in:
Eike Ziller
2022-05-11 11:53:47 +02:00
parent d35b9547f8
commit c311b8e0fa

View File

@@ -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()