summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-11-02 22:26:51 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-11-02 22:50:47 +0100
commite98fb8dd04c72988e25297d461fa9cf29233c1c2 (patch)
tree300acba5e80d5d0de3240b8505afef442b1faa1d /cmake
parentbf8578070f0d4b32c1c15109107d059a366cbda7 (diff)
downloadqttools-e98fb8dd04c72988e25297d461fa9cf29233c1c2.tar.gz
CMake: Fix FindWrapLibClang.cmake for multi-config builds
Do not error out if CMAKE_BUILD_TYPE is not a release configuration. In the multi-config case we must check that CMAKE_CONFIGURATION_TYPES contains at least one release configuration. Fixes: QTBUG-88039 Change-Id: I3b8eeede297dae8d0149739928431bc6e416396c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapLibClang.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmake/FindWrapLibClang.cmake b/cmake/FindWrapLibClang.cmake
index c8e388957..78a22cd04 100644
--- a/cmake/FindWrapLibClang.cmake
+++ b/cmake/FindWrapLibClang.cmake
@@ -32,7 +32,17 @@ if(TARGET libclang AND ((TARGET clang-cpp AND TARGET LLVM) OR TARGET clangHandle
get_target_property(type libclang TYPE)
if (MSVC AND type STREQUAL "STATIC_LIBRARY")
- if (NOT CMAKE_BUILD_TYPE MATCHES "(Release|MinSizeRel|RelWithDebInfo)")
+ get_property(__wrap_lib_clang_multi_config
+ GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(__wrap_lib_clang_multi_config)
+ set(__wrap_lib_clang_configs ${CMAKE_CONFIGURATION_TYPES})
+ else()
+ set(__wrap_lib_clang_configs ${CMAKE_BUILD_TYPE})
+ endif()
+ set(__wrap_lib_clang_non_release_configs ${configs})
+ list(REMOVE_ITEM __wrap_lib_clang_non_release_configs
+ Release MinSizeRel RelWithDebInfo)
+ if(__wrap_lib_clang_non_release_configs STREQUAL __wrap_lib_clang_configs)
message(STATUS "Static linkage against libclang with MSVC was requested, but the build is not a release build, therefore libclang cannot be used.")
set(WrapLibClang_FOUND FALSE)
endif()