diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-09-02 10:30:37 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-09-03 10:03:45 +0000 |
commit | 6cff79d377b4dc5e914873f008d3c6f1ec74ddf2 (patch) | |
tree | 9e38fd83e535f1eddfa3c3a7d5c14c1c7ce9a2bf /CMakeLists.txt | |
parent | 5b8846a4f889d9e700b9625ffefd8b22f64ea41e (diff) |
CMake build: Support building clang tooling without static libs
Create a FindClang.cmake and move all Clang configuration there.
Find Clang and choose static libraries if available, otherwise use
clang-cpp if available.
Add option to link to clang-cpp even if static libraries are available.
Fixes: QTCREATORBUG-23172
Change-Id: If40304d174469df0c786259e724cbee8de0e2d0e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d4cd30b44e..48770a5483 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,12 +43,11 @@ find_package(Qt5 QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT} REQUIRED ) - find_package(Qt5 COMPONENTS LinguistTools) +find_package(Qt5 COMPONENTS Designer DesignerComponents Help SerialPort Svg QUIET) find_package(Threads) - -find_package(Qt5 COMPONENTS Designer DesignerComponents Help SerialPort Svg QUIET) +find_package(Clang QUIET) function (set_if_target var target) if (TARGET "${target}") @@ -75,15 +74,6 @@ else() endif() install(TARGETS OptionalSvg EXPORT QtCreator) -find_package(Clang COMPONENTS libclang QUIET) -# silence a lot of warnings from building against llvm -# this would better fit inside a central libclang detection/include cmake file, but since we do not -# have one put it temporary here -if(MSVC AND TARGET libclang) - target_compile_options(libclang INTERFACE /wd4100 /wd4141 /wd4146 /wd4244 /wd4267 /wd4291) -endif() -find_package(LLVM QUIET) - if (APPLE) find_library(FWCoreFoundation CoreFoundation) find_library(FWCoreServices CoreServices) |