Allow to build ClangFormat plugin with CLANGTOOLING_LINK_CLANG_DYLIB

Some Linux distributives provides moders clang without separate libs
compiled, like libClangTooling and so on. Just provide libclang.so and
libclang-cpp.so.

Qt Creator provides way to handle such clang installation by
pointing flag CLANGTOOLING_LINK_CLANG_DYLIB=On for CMake. But
ClangFormat still keeps from building. Fixed it.

Change-Id: Id420f82c47c4205c8cd631aa04be6771628984be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alexander Drozdov
2022-01-27 14:13:48 +10:00
parent 707e7ba41f
commit 3869487a47

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(ClangFormat
CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH
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