cmake: Fix building debug with release libclang

Parts of QC cannot be linked against a release build of clangTooling
libs and vice versa when building on Windows.
Check whether the provided libs match the current build mode and
disable respective parts if necessary.
Re-use this information to decide whether unittest should be build
or not.

Change-Id: Ibc2aab0d7886e78ebbf8f15a43152efad49f1eff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2020-11-18 09:08:55 +01:00
parent 05a1b2a6e8
commit 6b62a99a8a
5 changed files with 20 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(ClangFormat
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH
DEPENDS Utils Qt5::Widgets clangFormat
INCLUDES "${CLANG_INCLUDE_DIRS}"
PLUGIN_DEPENDS Core TextEditor CppEditor CppTools ProjectExplorer