diff options
author | Cristian Adam <cristian.adam@qt.io> | 2022-04-28 19:12:17 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2022-05-06 16:40:22 +0000 |
commit | c0bca00bd965ce2e72104f97f91fb0e079274a22 (patch) | |
tree | 6601de15dbe753e9483173b240b69b16e5bc41ef /CMakeLists.txt | |
parent | 7e69b64b746e38838ffed25e99bfae454b8eb100 (diff) | |
download | qt-creator-c0bca00bd965ce2e72104f97f91fb0e079274a22.tar.gz |
CMake: Fix static build when using a static build of Qt
This fixes two issues:
1. the QT_FEATURE_static_runtime feature of a static build of Qt
2. the static sqlite sql driver bundled with a static build of Qt
Change-Id: Ia245ee3d8f7205c536c9fa77a4ba53ef066f968c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b11fceac71..ab4820ab55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,10 @@ else() # This includes the code that will enable higher compiler warnings level (/W3 for MSVC, -Wall -Wextra for GCC) # This is controlled by QT_COMPILE_OPTIONS_DISABLE_WARNINGS target property. include(QtCompilerFlags) + + if (MSVC AND QT_FEATURE_static_runtime) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") + endif() endif() find_package(Qt5 COMPONENTS LinguistTools QUIET) find_package(Qt5 COMPONENTS Quick QuickWidgets Designer DesignerComponents Help SerialPort Svg Tools QUIET) |