diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-14 11:55:59 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-15 17:12:57 +0200 |
commit | ba0d5ab5554243b0764bf3834c6faa9b98992389 (patch) | |
tree | 639be7333a29581555a3c8eb3987946626a3c10a /cmake/QtAutoDetect.cmake | |
parent | d79b3cbdd35a15559ccee0b733705349c0e0c523 (diff) |
CMake: Force Integrity to be a static Qt build
This was the case in Qt 5.15 as well.
The CMake toolchain file that Qt's CI is using is already setting
BUILD_SHARED_LIBS to OFF, but it's better to be explicit like we
are with WebAssembly and iOS.
Pick-to: 6.2
Change-Id: Ief17259c15690a97337e9df451663718601c2a52
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtAutoDetect.cmake')
-rw-r--r-- | cmake/QtAutoDetect.cmake | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index fdd49b95f6..ffa6028320 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -5,6 +5,16 @@ # Make sure to not run detection when building standalone tests, because the detection was already # done when initially configuring qtbase. +function(qt_internal_ensure_static_qt_config) + if(NOT DEFINED BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE) + endif() + + if(BUILD_SHARED_LIBS) + message(FATAL_ERROR + "Building Qt for ${CMAKE_SYSTEM_NAME} as shared libraries is not supported.") + endif() +endfunction() function(qt_auto_detect_wasm) if("${QT_QMAKE_TARGET_MKSPEC}" STREQUAL "wasm-emscripten" AND DEFINED ENV{EMSDK}) @@ -49,14 +59,7 @@ function(qt_auto_detect_wasm) endif() set(QT_AUTODETECT_WASM TRUE CACHE BOOL "") - if(NOT DEFINED BUILD_SHARED_LIBS) - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE) - endif() - - if(BUILD_SHARED_LIBS) - message(FATAL_ERROR - "Building Qt for ${CMAKE_SYSTEM_NAME} as shared libraries is not supported.") - endif() + qt_internal_ensure_static_qt_config() # this version of Qt needs this version of emscripten set(QT_EMCC_RECOMMENDED_VERSION 2.0.14 CACHE STRING INTERNAL FORCE) endif() @@ -261,14 +264,7 @@ function(qt_auto_detect_ios) endif() set(CMAKE_OSX_ARCHITECTURES "${osx_architectures}" CACHE STRING "") - if(NOT DEFINED BUILD_SHARED_LIBS) - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Qt statically or dynamically" FORCE) - endif() - - if(BUILD_SHARED_LIBS) - message(FATAL_ERROR - "Building Qt for ${CMAKE_SYSTEM_NAME} as shared libraries is not supported.") - endif() + qt_internal_ensure_static_qt_config() # Disable qt rpaths for iOS, just like mkspecs/common/uikit.conf does, due to those # bundles not being able to use paths outside the app bundle. Not sure this is strictly @@ -431,6 +427,17 @@ function(qt_auto_detect_win32_arm) endif() endfunction() +function(qt_auto_detect_integrity) + if( + # Qt's custom CMake toolchain file sets this value. + CMAKE_SYSTEM_NAME STREQUAL "Integrity" OR + + # Upstream CMake expects this name, but we don't currently use it in Qt. + CMAKE_SYSTEM_NAME STREQUAL "GHS-MULTI" + ) + qt_internal_ensure_static_qt_config() + endif() +endfunction() qt_auto_detect_cmake_generator() qt_auto_detect_cyclic_toolchain() @@ -443,3 +450,4 @@ qt_auto_detect_vcpkg() qt_auto_detect_pch() qt_auto_detect_wasm() qt_auto_detect_win32_arm() +qt_auto_detect_integrity() |