2022-07-05 11:26:52 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2022-08-19 13:21:34 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 11:26:52 +00:00
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
#### Inputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Libraries
|
|
|
|
|
2022-03-31 10:41:13 +00:00
|
|
|
qt_find_package(WrapSystemZLIB 1.0.8 PROVIDED_TARGETS WrapSystemZLIB::WrapSystemZLIB MODULE_NAME global QMAKE_LIB zlib)
|
2021-04-13 16:57:07 +00:00
|
|
|
# Work around global target promotion failure when WrapZLIB is used on APPLE platforms.
|
|
|
|
# What ends up happening is that the ZLIB::ZLIB target is not promoted to global by qt_find_package,
|
|
|
|
# then qt_find_package(WrapSystemPNG) tries to find its dependency ZLIB::ZLIB, sees it's not global
|
|
|
|
# and tries to promote it to global, but fails because the directory scope of the PNG package is
|
|
|
|
# different (src/gui) from where ZLIB was originally found (qtbase root).
|
|
|
|
# To avoid that, just manually promote the target to global here.
|
|
|
|
if(TARGET ZLIB::ZLIB)
|
|
|
|
set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)
|
|
|
|
endif()
|
|
|
|
|
2021-11-04 14:59:17 +00:00
|
|
|
qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders MODULE_NAME core)
|
|
|
|
# openssl_headers
|
|
|
|
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
|
|
|
qt_config_compile_test(opensslv11_headers
|
2023-08-23 16:09:52 +00:00
|
|
|
LABEL "opensslv11_headers"
|
2021-11-04 14:59:17 +00:00
|
|
|
LIBRARIES
|
|
|
|
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
|
|
|
CODE
|
|
|
|
"#include <openssl/ssl.h>
|
|
|
|
#include <openssl/opensslv.h>
|
|
|
|
#if !defined(OPENSSL_VERSION_NUMBER) || defined(OPENSSL_VERSION_MAJOR) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
|
|
|
|
# error OpenSSL >= 1.1.1 is required
|
|
|
|
#endif
|
|
|
|
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
|
|
|
|
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
qt_find_package(WrapOpenSSL PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL MODULE_NAME core QMAKE_LIB openssl)
|
|
|
|
# openssl
|
|
|
|
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
|
|
|
|
qt_config_compile_test(opensslv11
|
2023-08-23 16:09:52 +00:00
|
|
|
LABEL "opensslv11"
|
2021-11-04 14:59:17 +00:00
|
|
|
LIBRARIES
|
|
|
|
WrapOpenSSL::WrapOpenSSL
|
|
|
|
CODE
|
|
|
|
"#include <openssl/ssl.h>
|
|
|
|
#include <openssl/opensslv.h>
|
|
|
|
#if !defined(OPENSSL_VERSION_NUMBER) || defined(OPENSSL_VERSION_MAJOR) || OPENSSL_VERSION_NUMBER-0 < 0x10101000L
|
|
|
|
# error OpenSSL >= 1.1.1 is required
|
|
|
|
#endif
|
|
|
|
#if !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)
|
|
|
|
# error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it is libressl which is unsupported
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
SSL_free(SSL_new(0));
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
# opensslv30
|
|
|
|
# openssl_headers
|
|
|
|
qt_config_compile_test(opensslv30_headers
|
2023-08-23 16:09:52 +00:00
|
|
|
LABEL "opensslv30_headers"
|
2021-11-04 14:59:17 +00:00
|
|
|
LIBRARIES
|
|
|
|
WrapOpenSSLHeaders::WrapOpenSSLHeaders
|
|
|
|
CODE
|
|
|
|
"#include <openssl/ssl.h>
|
|
|
|
#include <openssl/opensslv.h>
|
|
|
|
#if !OPENSSL_VERSION_PREREQ(3,0)
|
|
|
|
# error OpenSSL >= 3.0 is required
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
qt_config_compile_test(opensslv30
|
2023-08-23 16:09:52 +00:00
|
|
|
LABEL "opensslv30"
|
2021-11-04 14:59:17 +00:00
|
|
|
LIBRARIES
|
|
|
|
WrapOpenSSL::WrapOpenSSL
|
|
|
|
CODE
|
|
|
|
"#include <openssl/ssl.h>
|
|
|
|
#include <openssl/opensslv.h>
|
|
|
|
#if !OPENSSL_VERSION_PREREQ(3,0)
|
|
|
|
# error OpenSSL >= 3.0 is required
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
SSL_free(SSL_new(0));
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
2022-02-23 11:29:08 +00:00
|
|
|
qt_find_package(WrapZSTD 1.3 PROVIDED_TARGETS WrapZSTD::WrapZSTD MODULE_NAME global QMAKE_LIB zstd)
|
2020-08-04 15:24:17 +00:00
|
|
|
qt_find_package(WrapDBus1 1.2 PROVIDED_TARGETS dbus-1 MODULE_NAME global QMAKE_LIB dbus)
|
2020-04-22 19:01:32 +00:00
|
|
|
qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev MODULE_NAME global QMAKE_LIB libudev)
|
2022-11-17 07:06:45 +00:00
|
|
|
qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST MODULE_NAME core QMAKE_LIB lttng-ust)
|
|
|
|
qt_add_qmake_lib_dependency(lttng-ust libdl)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
|
|
|
|
2021-07-12 10:43:27 +00:00
|
|
|
#### Early-evaluated, Linker-related Tests and Features
|
|
|
|
|
2021-12-16 17:51:31 +00:00
|
|
|
qt_internal_check_if_linker_is_available(use_bfd_linker
|
2021-07-12 10:43:27 +00:00
|
|
|
LABEL "bfd linker"
|
|
|
|
FLAG "-fuse-ld=bfd"
|
|
|
|
)
|
|
|
|
|
2021-12-16 17:51:31 +00:00
|
|
|
qt_internal_check_if_linker_is_available(use_gold_linker
|
2021-07-12 10:43:27 +00:00
|
|
|
LABEL "gold linker"
|
|
|
|
FLAG "-fuse-ld=gold"
|
|
|
|
)
|
|
|
|
|
2021-12-16 17:51:31 +00:00
|
|
|
qt_internal_check_if_linker_is_available(use_lld_linker
|
2021-07-12 10:43:27 +00:00
|
|
|
LABEL "lld linker"
|
|
|
|
FLAG "-fuse-ld=lld"
|
|
|
|
)
|
|
|
|
|
2021-12-16 12:25:43 +00:00
|
|
|
# We set an invalid flag as a default flag so the compile test fails
|
|
|
|
# in case if no mold is found in PATH.
|
|
|
|
set(__qt_internal_mold_linker_flags "-Wl,-invalid-flag")
|
|
|
|
if(NOT QT_CONFIGURE_RUNNING)
|
|
|
|
qt_internal_get_mold_linker_flags(__qt_internal_mold_linker_flags)
|
|
|
|
endif()
|
|
|
|
qt_internal_check_if_linker_is_available(use_mold_linker
|
|
|
|
LABEL "mold linker"
|
|
|
|
FLAG "${__qt_internal_mold_linker_flags}"
|
|
|
|
)
|
|
|
|
unset(__qt_internal_mold_linker_flags)
|
|
|
|
|
2021-07-12 10:43:27 +00:00
|
|
|
qt_feature("use_bfd_linker"
|
|
|
|
PRIVATE
|
|
|
|
LABEL "bfd"
|
|
|
|
AUTODETECT false
|
2022-10-24 10:42:12 +00:00
|
|
|
CONDITION NOT MSVC AND NOT INTEGRITY AND NOT WASM AND TEST_use_bfd_linker
|
2021-07-12 10:43:27 +00:00
|
|
|
ENABLE INPUT_linker STREQUAL 'bfd'
|
|
|
|
DISABLE INPUT_linker STREQUAL 'gold' OR INPUT_linker STREQUAL 'lld'
|
2021-12-16 12:25:43 +00:00
|
|
|
OR INPUT_linker STREQUAL 'mold'
|
2021-07-12 10:43:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("use_bfd_linker" QMAKE_PRIVATE_CONFIG)
|
|
|
|
|
|
|
|
qt_feature("use_gold_linker_alias"
|
|
|
|
AUTODETECT false
|
|
|
|
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_gold_linker
|
|
|
|
)
|
|
|
|
qt_feature("use_gold_linker"
|
|
|
|
PRIVATE
|
|
|
|
LABEL "gold"
|
|
|
|
AUTODETECT false
|
|
|
|
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND NOT rtems AND TEST_use_gold_linker
|
|
|
|
ENABLE INPUT_linker STREQUAL 'gold' OR QT_FEATURE_use_gold_linker_alias
|
|
|
|
DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'lld'
|
2021-12-16 12:25:43 +00:00
|
|
|
OR INPUT_linker STREQUAL 'mold'
|
2021-07-12 10:43:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("use_gold_linker" QMAKE_PRIVATE_CONFIG)
|
|
|
|
|
|
|
|
qt_feature("use_lld_linker"
|
|
|
|
PRIVATE
|
|
|
|
LABEL "lld"
|
|
|
|
AUTODETECT false
|
2022-10-24 10:42:12 +00:00
|
|
|
CONDITION NOT MSVC AND NOT INTEGRITY AND NOT WASM AND TEST_use_lld_linker
|
2021-07-12 10:43:27 +00:00
|
|
|
ENABLE INPUT_linker STREQUAL 'lld'
|
|
|
|
DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'gold'
|
2021-12-16 12:25:43 +00:00
|
|
|
OR INPUT_linker STREQUAL 'mold'
|
2021-07-12 10:43:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("use_lld_linker" QMAKE_PRIVATE_CONFIG)
|
|
|
|
|
2021-12-16 12:25:43 +00:00
|
|
|
qt_feature("use_mold_linker"
|
|
|
|
PRIVATE
|
|
|
|
LABEL "mold"
|
|
|
|
AUTODETECT FALSE
|
|
|
|
CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_mold_linker
|
|
|
|
ENABLE INPUT_linker STREQUAL 'mold'
|
|
|
|
DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'gold'
|
|
|
|
OR INPUT_linker STREQUAL 'lld'
|
|
|
|
)
|
|
|
|
qt_feature_config("use_mold_linker" QMAKE_PRIVATE_CONFIG)
|
|
|
|
|
2021-07-12 10:43:27 +00:00
|
|
|
if(NOT QT_CONFIGURE_RUNNING)
|
|
|
|
qt_evaluate_feature(use_bfd_linker)
|
|
|
|
qt_evaluate_feature(use_gold_linker_alias)
|
|
|
|
qt_evaluate_feature(use_gold_linker)
|
|
|
|
qt_evaluate_feature(use_lld_linker)
|
2021-12-16 12:25:43 +00:00
|
|
|
qt_evaluate_feature(use_mold_linker)
|
2021-07-12 10:43:27 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
#### Tests
|
|
|
|
|
2020-06-26 18:45:11 +00:00
|
|
|
# machineTuple
|
|
|
|
qt_config_compile_test_machine_tuple("machine tuple")
|
|
|
|
|
2021-02-09 12:12:09 +00:00
|
|
|
# cxx20
|
|
|
|
qt_config_compile_test(cxx20
|
|
|
|
LABEL "C++20 support"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2019-05-28 14:19:42 +00:00
|
|
|
"#if __cplusplus > 201703L
|
2021-02-09 12:12:09 +00:00
|
|
|
// Compiler claims to support C++20, trust it
|
2019-05-28 14:19:42 +00:00
|
|
|
#else
|
|
|
|
# error __cplusplus must be > 201703L (the value for C++17)
|
|
|
|
#endif
|
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2019-05-28 14:19:42 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
2019-10-17 08:49:44 +00:00
|
|
|
"
|
|
|
|
CXX_STANDARD 20
|
2019-05-28 14:19:42 +00:00
|
|
|
)
|
|
|
|
|
2022-02-04 10:52:55 +00:00
|
|
|
qt_config_compile_test(cxx2b
|
|
|
|
LABEL "C++2b support"
|
|
|
|
CODE
|
|
|
|
"#if __cplusplus > 202002L
|
|
|
|
// Compiler claims to support C++2B, trust it
|
|
|
|
#else
|
|
|
|
# error __cplusplus must be > 202002L (the value for C++20)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
"
|
|
|
|
CXX_STANDARD 23
|
|
|
|
)
|
|
|
|
|
2019-04-16 14:32:08 +00:00
|
|
|
# precompile_header
|
|
|
|
qt_config_compile_test(precompile_header
|
|
|
|
LABEL "precompiled header support"
|
2021-06-17 20:18:22 +00:00
|
|
|
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/precompile_header"
|
2019-04-16 14:32:08 +00:00
|
|
|
)
|
|
|
|
|
2020-08-19 14:49:13 +00:00
|
|
|
qt_config_compiler_supports_flag_test(optimize_debug
|
|
|
|
LABEL "-Og support"
|
|
|
|
FLAG "-Og"
|
|
|
|
)
|
|
|
|
|
2022-07-15 23:32:11 +00:00
|
|
|
qt_config_compile_test(no_direct_extern_access
|
|
|
|
LABEL "-mno-direct-extern-access / -fno-direct-access-external-data support"
|
|
|
|
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/no_direct_extern_access"
|
2012-01-23 13:46:58 +00:00
|
|
|
)
|
|
|
|
|
2020-08-21 10:59:24 +00:00
|
|
|
qt_config_linker_supports_flag_test(enable_new_dtags
|
|
|
|
LABEL "new dtags support"
|
|
|
|
FLAG "--enable-new-dtags"
|
|
|
|
)
|
|
|
|
|
|
|
|
qt_config_linker_supports_flag_test(gdb_index
|
|
|
|
LABEL "gdb index support"
|
|
|
|
FLAG "--gdb-index"
|
|
|
|
)
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
# reduce_relocations
|
|
|
|
qt_config_compile_test(reduce_relocations
|
|
|
|
LABEL "-Bsymbolic-functions support"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2021-04-27 14:53:47 +00:00
|
|
|
"#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) || defined(__sun)
|
2018-10-24 13:20:27 +00:00
|
|
|
# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
|
|
|
|
#endif
|
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
"# FIXME: qmake: ['TEMPLATE = lib', 'CONFIG += dll bsymbolic_functions', 'isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")']
|
|
|
|
)
|
|
|
|
|
2023-06-12 12:42:20 +00:00
|
|
|
if(NOT MSVC AND NOT APPLE)
|
|
|
|
qt_config_compile_test("separate_debug_info"
|
|
|
|
LABEL "separate debug information support"
|
|
|
|
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/separate_debug_info"
|
|
|
|
)
|
|
|
|
endif()
|
2020-02-26 10:41:20 +00:00
|
|
|
|
2019-10-11 14:55:55 +00:00
|
|
|
# signaling_nan
|
|
|
|
qt_config_compile_test(signaling_nan
|
|
|
|
LABEL "Signaling NaN for doubles"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2022-02-08 13:30:56 +00:00
|
|
|
"#if defined(__ghs) && (__GHS_VERSION_NUMBER <= 202014)
|
|
|
|
# error Signal NaNs are not supported by GHS compiler, but has_signaling_NaN returns TRUE. Will be fixed in future compiler releases.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <limits>
|
2019-10-11 14:55:55 +00:00
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2019-10-11 14:55:55 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
using B = std::numeric_limits<double>;
|
|
|
|
static_assert(B::has_signaling_NaN, \"System lacks signaling NaN\");
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
2022-02-24 02:03:40 +00:00
|
|
|
# basic x86 intrinsics support
|
|
|
|
qt_config_compile_test(x86intrin
|
|
|
|
LABEL "Basic x86 intrinsics"
|
|
|
|
PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/x86intrin"
|
|
|
|
)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2022-02-24 01:54:40 +00:00
|
|
|
# x86: avx512vbmi2
|
|
|
|
qt_config_compile_test_x86simd(avx512vbmi2 "AVX512VBMI2")
|
|
|
|
|
|
|
|
# x86: vaes
|
|
|
|
qt_config_compile_test_x86simd(vaes "VAES")
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
# posix_fallocate
|
|
|
|
qt_config_compile_test(posix_fallocate
|
|
|
|
LABEL "POSIX fallocate()"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2021-02-12 15:40:33 +00:00
|
|
|
"#include <fcntl.h>
|
2018-10-24 13:20:27 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
(void) posix_fallocate(0, 0, 0);
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
# alloca_stdlib_h
|
|
|
|
qt_config_compile_test(alloca_stdlib_h
|
|
|
|
LABEL "alloca() in stdlib.h"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2021-02-12 15:40:33 +00:00
|
|
|
"#include <stdlib.h>
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
alloca(1);
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
# alloca_h
|
|
|
|
qt_config_compile_test(alloca_h
|
|
|
|
LABEL "alloca() in alloca.h"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2021-02-12 15:40:33 +00:00
|
|
|
"#include <alloca.h>
|
2018-10-24 13:20:27 +00:00
|
|
|
#ifdef __QNXNTO__
|
|
|
|
// extra include needed in QNX7 to define NULL for the alloca() macro
|
|
|
|
# include <stddef.h>
|
|
|
|
#endif
|
2021-02-12 15:40:33 +00:00
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
alloca(1);
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
# alloca_malloc_h
|
|
|
|
qt_config_compile_test(alloca_malloc_h
|
|
|
|
LABEL "alloca() in malloc.h"
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2021-02-12 15:40:33 +00:00
|
|
|
"#include <malloc.h>
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
alloca(1);
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
|
|
|
# stack_protector
|
|
|
|
qt_config_compile_test(stack_protector
|
|
|
|
LABEL "stack protection"
|
2020-02-26 09:39:47 +00:00
|
|
|
COMPILE_OPTIONS -fstack-protector-strong
|
2019-10-21 12:35:57 +00:00
|
|
|
CODE
|
2018-10-24 13:20:27 +00:00
|
|
|
"#ifdef __QNXNTO__
|
|
|
|
# include <sys/neutrino.h>
|
|
|
|
# if _NTO_VERSION < 700
|
|
|
|
# error stack-protector not used (by default) before QNX 7.0.0.
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2021-02-12 11:31:17 +00:00
|
|
|
int main(void)
|
2018-10-24 13:20:27 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
2020-02-26 09:39:47 +00:00
|
|
|
")
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2020-05-29 17:01:36 +00:00
|
|
|
# intelcet
|
|
|
|
qt_config_compile_test(intelcet
|
2022-09-20 09:42:39 +00:00
|
|
|
LABEL "Support for Intel Control-flow Enforcement Technology (CET)"
|
2020-05-29 17:01:36 +00:00
|
|
|
CODE
|
2021-02-12 15:40:33 +00:00
|
|
|
"int main(void)
|
2020-05-29 17:01:36 +00:00
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
#if !defined(__CET__)
|
|
|
|
# error Intel CET not available
|
|
|
|
#endif
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
#### Features
|
|
|
|
|
|
|
|
# This belongs into gui, but the license check needs it here already.
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature("android-style-assets" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Android Style Assets"
|
|
|
|
CONDITION ANDROID
|
|
|
|
)
|
2020-02-26 12:08:10 +00:00
|
|
|
qt_feature("shared" PUBLIC
|
|
|
|
LABEL "Building shared libraries"
|
|
|
|
CONDITION BUILD_SHARED_LIBS
|
|
|
|
)
|
2020-03-31 12:12:01 +00:00
|
|
|
qt_feature_definition("shared" "QT_STATIC" NEGATE PREREQUISITE "!defined(QT_SHARED) && !defined(QT_STATIC)")
|
2020-02-26 12:08:10 +00:00
|
|
|
qt_feature_config("shared" QMAKE_PUBLIC_QT_CONFIG)
|
|
|
|
qt_feature_config("shared" QMAKE_PUBLIC_CONFIG)
|
2020-04-01 20:26:19 +00:00
|
|
|
qt_feature("static" PUBLIC
|
|
|
|
CONDITION NOT QT_FEATURE_shared
|
|
|
|
)
|
|
|
|
qt_feature_config("static" QMAKE_PUBLIC_QT_CONFIG)
|
|
|
|
qt_feature_config("static" QMAKE_PUBLIC_CONFIG)
|
2020-04-16 20:33:14 +00:00
|
|
|
qt_feature("cross_compile" PUBLIC
|
|
|
|
LABEL "Cross compiling"
|
|
|
|
CONDITION CMAKE_CROSSCOMPILING
|
|
|
|
)
|
|
|
|
qt_feature_config("cross_compile" QMAKE_PUBLIC_CONFIG)
|
|
|
|
qt_feature_config("cross_compile" QMAKE_PRIVATE_CONFIG)
|
2020-06-12 17:12:26 +00:00
|
|
|
qt_feature("gc_binaries" PRIVATE
|
|
|
|
CONDITION NOT QT_FEATURE_shared
|
|
|
|
)
|
2020-08-20 08:19:32 +00:00
|
|
|
qt_feature("optimize_debug"
|
|
|
|
LABEL "Optimize debug build"
|
|
|
|
AUTODETECT NOT QT_FEATURE_developer_build
|
|
|
|
CONDITION NOT MSVC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release ) AND TEST_optimize_debug
|
|
|
|
)
|
|
|
|
qt_feature_config("optimize_debug" QMAKE_PRIVATE_CONFIG)
|
2020-08-21 06:40:54 +00:00
|
|
|
qt_feature("optimize_size"
|
|
|
|
LABEL "Optimize release build for size"
|
|
|
|
AUTODETECT OFF
|
|
|
|
CONDITION NOT QT_FEATURE_debug OR QT_FEATURE_debug_and_release
|
|
|
|
)
|
|
|
|
qt_feature_config("optimize_size" QMAKE_PRIVATE_CONFIG)
|
2020-10-05 07:09:13 +00:00
|
|
|
qt_feature("optimize_full"
|
|
|
|
LABEL "Fully optimize release builds (-O3)"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("optimize_full" QMAKE_PRIVATE_CONFIG)
|
2020-10-02 16:24:32 +00:00
|
|
|
qt_feature("msvc_obj_debug_info"
|
|
|
|
LABEL "Embed debug info in object files (MSVC)"
|
|
|
|
CONDITION MSVC
|
2023-05-05 12:26:16 +00:00
|
|
|
ENABLE QT_USE_CCACHE
|
2020-10-02 16:24:32 +00:00
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("msvc_obj_debug_info" QMAKE_PRIVATE_CONFIG)
|
2020-04-16 05:08:06 +00:00
|
|
|
qt_feature("pkg-config" PUBLIC
|
|
|
|
LABEL "Using pkg-config"
|
2020-09-28 08:40:47 +00:00
|
|
|
AUTODETECT NOT APPLE AND NOT WIN32 AND NOT ANDROID
|
2020-04-16 05:08:06 +00:00
|
|
|
CONDITION PKG_CONFIG_FOUND
|
|
|
|
)
|
|
|
|
qt_feature_config("pkg-config" QMAKE_PUBLIC_QT_CONFIG
|
|
|
|
NEGATE)
|
2022-02-22 17:51:16 +00:00
|
|
|
qt_feature("developer-build" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Developer build"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
2023-09-04 13:05:55 +00:00
|
|
|
qt_feature("no-prefix"
|
2022-02-22 17:51:16 +00:00
|
|
|
LABEL "No prefix build"
|
2022-04-13 15:47:56 +00:00
|
|
|
AUTODETECT NOT QT_WILL_INSTALL
|
|
|
|
CONDITION NOT QT_WILL_INSTALL
|
2022-02-22 17:51:16 +00:00
|
|
|
)
|
2019-03-14 12:22:09 +00:00
|
|
|
qt_feature("private_tests" PRIVATE
|
|
|
|
LABEL "Developer build: private_tests"
|
2019-07-17 14:10:31 +00:00
|
|
|
CONDITION QT_FEATURE_developer_build
|
2019-03-14 12:22:09 +00:00
|
|
|
)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_definition("developer-build" "QT_BUILD_INTERNAL")
|
|
|
|
qt_feature_config("developer-build" QMAKE_PUBLIC_QT_CONFIG
|
|
|
|
NAME "private_tests"
|
|
|
|
)
|
2021-06-16 06:44:36 +00:00
|
|
|
qt_feature("debug" PRIVATE
|
2020-02-26 11:53:30 +00:00
|
|
|
LABEL "Build for debugging"
|
2020-08-21 13:16:31 +00:00
|
|
|
AUTODETECT ON
|
2020-03-06 08:28:12 +00:00
|
|
|
CONDITION CMAKE_BUILD_TYPE STREQUAL Debug OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES
|
2020-02-26 11:53:30 +00:00
|
|
|
)
|
2020-02-26 12:23:05 +00:00
|
|
|
qt_feature("debug_and_release" PUBLIC
|
|
|
|
LABEL "Compile libs in debug and release mode"
|
|
|
|
AUTODETECT 1
|
|
|
|
CONDITION QT_GENERATOR_IS_MULTI_CONFIG
|
|
|
|
)
|
|
|
|
qt_feature_config("debug_and_release" QMAKE_PUBLIC_QT_CONFIG)
|
2020-02-26 12:38:23 +00:00
|
|
|
qt_feature("force_debug_info"
|
|
|
|
LABEL "Add debug info in release mode"
|
|
|
|
AUTODETECT CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo OR RelWithDebInfo IN_LIST CMAKE_CONFIGURATION_TYPES
|
|
|
|
)
|
|
|
|
qt_feature_config("force_debug_info" QMAKE_PRIVATE_CONFIG)
|
2020-02-26 10:41:20 +00:00
|
|
|
qt_feature("separate_debug_info" PUBLIC
|
|
|
|
LABEL "Split off debug information"
|
|
|
|
AUTODETECT OFF
|
2023-06-12 12:42:20 +00:00
|
|
|
CONDITION ( QT_FEATURE_shared ) AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release OR QT_FEATURE_force_debug_info ) AND ( MSVC OR APPLE OR TEST_separate_debug_info )
|
2020-02-26 10:41:20 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("separate_debug_info" QMAKE_PUBLIC_QT_CONFIG)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature("appstore-compliant" PUBLIC
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "App store compliance"
|
|
|
|
PURPOSE "Disables code that is not allowed in platform app stores"
|
2020-06-05 07:24:37 +00:00
|
|
|
AUTODETECT UIKIT OR ANDROID
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
2022-02-01 14:44:06 +00:00
|
|
|
if(APPLE)
|
|
|
|
qt_feature_definition("appstore-compliant" "QT_APPLE_NO_PRIVATE_APIS")
|
|
|
|
endif()
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("simulator_and_device" PUBLIC
|
|
|
|
LABEL "Build for both simulator and device"
|
2020-03-16 12:36:47 +00:00
|
|
|
CONDITION UIKIT AND NOT QT_UIKIT_SDK
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("simulator_and_device" QMAKE_PUBLIC_QT_CONFIG)
|
2020-03-31 07:39:50 +00:00
|
|
|
qt_feature("rpath" PUBLIC
|
|
|
|
LABEL "Build with RPATH"
|
|
|
|
AUTODETECT 1
|
CMake: Handle automatic rpath embedding correctly
Instead of using CMAKE_INSTALL_RPATH to embed an absolute path
to prefix/libdir into all targets, use the more sophisticated aproach
that qmake does.
For certain targets (modules, plugins, tools) use relative rpaths.
Otherwise embed absolute paths (examples, regular binaries).
Installed tests currently have no rpaths.
On certain platforms rpaths are not used (Windows, Android,
iOS / uikit).
Frameworks, app bundles and shallow bundles should also be handled
correctly.
Additional rpaths can be provided via QT_EXTRA_RPATHS variable
(similar to the -R option that configure takes).
Automatic embedding can be disabled either via QT_FEATURE_rpath=OFF
or QT_DISABLE_RPATH=ON.
Note that installed examples are not relocatable at the moment (due
to always having an absolute path rpath), so this is a missing feature
compared to qmake. This is due to missing information on where
examples will be installed, so a relative rpath can not be computed.
By default a Qt installation is relocatable, so there is no need to
pass -DQT_EXTRA_RPATHS=. like Coin used to do with qmake e.g. -R .
Relative rpaths will have the appropriate 'relative base' prefixed
to them (e.g $ORIGIN on linux and @loader_path on darwin platforms).
There is currently no support for other platforms that might have a
different 'relative base' than the ones mentioned above.
Any extra rpaths are saved to BuildInternalsExtra which are re-used
when building other repositories.
configurejson2cmake modified to include correct conditions for the
rpath feature.
It's very likely that we will need a new qt_add_internal_app()
function for gui apps that are to be installed to prefix/bin.
For example for Assistant from qttools. Currently such apps
use qt_add_executable().
The distinction is necessary to make sure that relative rpaths are
embedded into apps, but not executables (which tests are part of).
Amends e835a6853b9c0fb7af32798ed8965de3adf0e15b
Task-number: QTBUG-83497
Change-Id: I3510f63c0a59489741116cc8ec3ef6a0a7704f25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-15 16:48:26 +00:00
|
|
|
CONDITION BUILD_SHARED_LIBS AND UNIX AND NOT WIN32 AND NOT ANDROID
|
2020-03-31 07:39:50 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("rpath" QMAKE_PUBLIC_QT_CONFIG)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("force_asserts" PUBLIC
|
|
|
|
LABEL "Force assertions"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature("headersclean"
|
|
|
|
LABEL "Check for clean headers"
|
2020-05-13 13:35:52 +00:00
|
|
|
AUTODETECT OFF
|
2019-11-29 18:45:38 +00:00
|
|
|
CONDITION NOT WASM
|
|
|
|
)
|
|
|
|
qt_feature_config("headersclean" QMAKE_PRIVATE_CONFIG)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("framework" PUBLIC
|
|
|
|
LABEL "Build Apple Frameworks"
|
2020-03-09 12:37:41 +00:00
|
|
|
CONDITION APPLE AND BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE STREQUAL Debug
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("framework" QMAKE_PUBLIC_QT_CONFIG
|
|
|
|
NAME "qt_framework"
|
|
|
|
)
|
|
|
|
qt_feature_config("framework" QMAKE_PUBLIC_CONFIG
|
|
|
|
NAME "qt_framework"
|
|
|
|
)
|
2019-03-14 12:22:09 +00:00
|
|
|
qt_feature("largefile"
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Large file support"
|
2020-06-05 07:24:37 +00:00
|
|
|
CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT rtems
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("largefile" "QT_LARGEFILE_SUPPORT" VALUE "64")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("largefile" QMAKE_PRIVATE_CONFIG)
|
2020-06-15 07:50:42 +00:00
|
|
|
qt_feature("sanitize_address"
|
|
|
|
LABEL "Addresses"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitize_address" QMAKE_PUBLIC_CONFIG)
|
|
|
|
qt_feature("sanitize_thread"
|
|
|
|
LABEL "Threads"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitize_thread" QMAKE_PUBLIC_CONFIG)
|
|
|
|
qt_feature("sanitize_memory"
|
|
|
|
LABEL "Memory"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitize_memory" QMAKE_PUBLIC_CONFIG)
|
2020-01-16 09:42:05 +00:00
|
|
|
qt_feature("sanitize_fuzzer_no_link"
|
|
|
|
LABEL "Fuzzer (instrumentation only)"
|
|
|
|
PURPOSE "Adds instrumentation for fuzzing to the binaries but links to the usual main function instead of a fuzzer's."
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitize_fuzzer_no_link" QMAKE_PUBLIC_CONFIG)
|
2020-06-15 07:50:42 +00:00
|
|
|
qt_feature("sanitize_undefined"
|
|
|
|
LABEL "Undefined"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitize_undefined" QMAKE_PUBLIC_CONFIG)
|
|
|
|
qt_feature("sanitizer"
|
|
|
|
LABEL "Sanitizers"
|
|
|
|
CONDITION QT_FEATURE_sanitize_address OR QT_FEATURE_sanitize_thread OR QT_FEATURE_sanitize_memory OR QT_FEATURE_sanitize_fuzzer_no_link OR QT_FEATURE_sanitize_undefined
|
|
|
|
)
|
|
|
|
qt_feature_config("sanitizer" QMAKE_PUBLIC_CONFIG)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature("plugin-manifests"
|
|
|
|
LABEL "Embed manifests in plugins"
|
|
|
|
AUTODETECT OFF
|
|
|
|
EMIT_IF WIN32
|
|
|
|
)
|
|
|
|
qt_feature_config("plugin-manifests" QMAKE_PUBLIC_CONFIG
|
|
|
|
NEGATE
|
|
|
|
NAME "no_plugin_manifest"
|
|
|
|
)
|
2021-02-09 12:12:09 +00:00
|
|
|
qt_feature("c++20" PUBLIC
|
|
|
|
LABEL "C++20"
|
2019-05-28 14:19:42 +00:00
|
|
|
AUTODETECT OFF
|
2023-02-28 19:42:22 +00:00
|
|
|
CONDITION TEST_cxx20
|
2021-02-09 12:12:09 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("c++20" QMAKE_PUBLIC_QT_CONFIG)
|
|
|
|
qt_feature("c++2a" PUBLIC
|
|
|
|
LABEL "C++20"
|
|
|
|
CONDITION QT_FEATURE_cxx20
|
2019-05-28 14:19:42 +00:00
|
|
|
)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("c++2a" QMAKE_PUBLIC_QT_CONFIG)
|
2022-04-13 07:01:48 +00:00
|
|
|
qt_feature("c++2b" PUBLIC
|
|
|
|
LABEL "C++2b"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_config("c++2b" QMAKE_PUBLIC_QT_CONFIG)
|
2022-02-04 10:52:55 +00:00
|
|
|
qt_feature("c++2b" PUBLIC
|
|
|
|
LABEL "C++2b"
|
|
|
|
AUTODETECT FALSE
|
|
|
|
CONDITION QT_FEATURE_cxx20 AND (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20") AND TEST_cxx2b
|
|
|
|
)
|
2020-04-03 14:33:24 +00:00
|
|
|
qt_feature("precompile_header"
|
|
|
|
LABEL "Using precompiled headers"
|
2021-06-17 20:18:22 +00:00
|
|
|
CONDITION BUILD_WITH_PCH AND TEST_precompile_header
|
2020-09-03 08:29:41 +00:00
|
|
|
AUTODETECT NOT WASM
|
2020-04-03 14:33:24 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("precompile_header" QMAKE_PRIVATE_CONFIG)
|
2020-08-27 12:11:00 +00:00
|
|
|
set(__qt_ltcg_detected FALSE)
|
|
|
|
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
|
|
|
set(__qt_ltcg_detected TRUE)
|
|
|
|
else()
|
|
|
|
foreach(config ${CMAKE_BUILD_TYPE} ${CMAKE_CONFIGURATION_TYPES})
|
2020-11-05 10:14:17 +00:00
|
|
|
string(TOUPPER "${config}" __qt_uc_config)
|
|
|
|
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION_${__qt_uc_config})
|
2020-08-27 12:11:00 +00:00
|
|
|
set(__qt_ltcg_detected TRUE)
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2020-11-05 10:14:17 +00:00
|
|
|
unset(__qt_uc_config)
|
2020-08-27 12:11:00 +00:00
|
|
|
endif()
|
2020-04-17 06:39:47 +00:00
|
|
|
qt_feature("ltcg"
|
2022-09-26 03:43:11 +00:00
|
|
|
LABEL "Using Link Time Optimization (LTCG)"
|
2020-08-27 12:11:00 +00:00
|
|
|
AUTODETECT ON
|
|
|
|
CONDITION __qt_ltcg_detected
|
2020-04-17 06:39:47 +00:00
|
|
|
)
|
|
|
|
qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG)
|
2021-08-19 20:13:53 +00:00
|
|
|
|
|
|
|
if(NOT QT_CONFIGURE_RUNNING)
|
|
|
|
# This feature is used early in QtCompilerOptimization.cmake.
|
|
|
|
qt_evaluate_feature(ltcg)
|
|
|
|
endif()
|
|
|
|
|
2020-12-21 18:29:30 +00:00
|
|
|
qt_feature("enable_new_dtags"
|
|
|
|
LABEL "Using new DTAGS"
|
|
|
|
CONDITION LINUX AND TEST_enable_new_dtags
|
|
|
|
)
|
|
|
|
qt_feature_config("enable_new_dtags" QMAKE_PRIVATE_CONFIG)
|
2020-08-21 07:22:23 +00:00
|
|
|
qt_feature("enable_gdb_index"
|
|
|
|
LABEL "Generating GDB index"
|
|
|
|
AUTODETECT QT_FEATURE_developer_build
|
|
|
|
CONDITION GCC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_force_debug_info OR QT_FEATURE_debug_and_release ) AND TEST_gdb_index
|
|
|
|
)
|
|
|
|
qt_feature_config("enable_gdb_index" QMAKE_PRIVATE_CONFIG)
|
2019-03-14 12:22:09 +00:00
|
|
|
qt_feature("reduce_exports" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Reduce amount of exported symbols"
|
2020-08-25 06:17:23 +00:00
|
|
|
CONDITION NOT MSVC
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("reduce_exports" "QT_VISIBILITY_AVAILABLE")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("reduce_exports" QMAKE_PUBLIC_QT_CONFIG)
|
2022-07-15 23:32:11 +00:00
|
|
|
qt_feature("no_direct_extern_access" PRIVATE
|
2012-01-23 13:46:58 +00:00
|
|
|
LABEL "Use protected visibility and -mno-direct-extern-access"
|
2022-07-15 23:32:11 +00:00
|
|
|
CONDITION NOT WIN32 AND TEST_no_direct_extern_access
|
2022-07-18 18:06:20 +00:00
|
|
|
AUTODETECT OFF
|
2012-01-23 13:46:58 +00:00
|
|
|
)
|
2022-07-15 23:32:11 +00:00
|
|
|
qt_feature_definition("no_direct_extern_access" "QT_USE_PROTECTED_VISIBILITY")
|
|
|
|
qt_feature_config("no_direct_extern_access" QMAKE_PUBLIC_QT_CONFIG)
|
2012-01-23 13:46:58 +00:00
|
|
|
qt_feature("reduce_relocations" PUBLIC
|
2020-02-17 13:58:16 +00:00
|
|
|
LABEL "Reduce amount of relocations"
|
|
|
|
CONDITION NOT WIN32 AND TEST_reduce_relocations
|
|
|
|
)
|
|
|
|
qt_feature_definition("reduce_relocations" "QT_REDUCE_RELOCATIONS")
|
|
|
|
qt_feature_config("reduce_relocations" QMAKE_PUBLIC_QT_CONFIG)
|
2019-10-11 14:55:55 +00:00
|
|
|
qt_feature("signaling_nan" PUBLIC
|
|
|
|
LABEL "Signaling NaN"
|
|
|
|
CONDITION TEST_signaling_nan
|
|
|
|
)
|
2022-02-24 02:03:40 +00:00
|
|
|
qt_feature("x86intrin" PRIVATE
|
|
|
|
LABEL "Basic"
|
|
|
|
CONDITION (((TEST_architecture_arch STREQUAL i386) OR (TEST_architecture_arch STREQUAL x86_64))
|
|
|
|
AND (QT_FORCE_FEATURE_x86intrin OR TEST_x86intrin))
|
2021-04-16 05:34:57 +00:00
|
|
|
AUTODETECT NOT WASM
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
2022-02-24 02:03:40 +00:00
|
|
|
qt_feature("sse2" PRIVATE
|
|
|
|
CONDITION QT_FEATURE_x86intrin
|
|
|
|
)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature_definition("sse2" "QT_COMPILER_SUPPORTS_SSE2" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("sse2" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("sse3" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("sse3" "QT_COMPILER_SUPPORTS_SSE3" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("sse3" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("ssse3" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("ssse3" "QT_COMPILER_SUPPORTS_SSSE3" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("ssse3" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("sse4_1" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("sse4_1" "QT_COMPILER_SUPPORTS_SSE4_1" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("sse4_1" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("sse4_2" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("sse4_2" "QT_COMPILER_SUPPORTS_SSE4_2" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("sse4_2" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx" "QT_COMPILER_SUPPORTS_AVX" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("f16c" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("f16c" "QT_COMPILER_SUPPORTS_F16C" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("f16c" QMAKE_PRIVATE_CONFIG)
|
2019-03-14 12:22:09 +00:00
|
|
|
qt_feature("avx2" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx2" "QT_COMPILER_SUPPORTS_AVX2" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx2" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512f" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512f" "QT_COMPILER_SUPPORTS_AVX512F" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512f" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512er" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512er" "QT_COMPILER_SUPPORTS_AVX512ER" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512er" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512cd" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512cd" "QT_COMPILER_SUPPORTS_AVX512CD" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512cd" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512pf" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512pf" "QT_COMPILER_SUPPORTS_AVX512PF" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512pf" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512dq" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512dq" "QT_COMPILER_SUPPORTS_AVX512DQ" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512dq" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512bw" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512bw" "QT_COMPILER_SUPPORTS_AVX512BW" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512bw" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512vl" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512vl" "QT_COMPILER_SUPPORTS_AVX512VL" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512vl" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512ifma" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512ifma" "QT_COMPILER_SUPPORTS_AVX512IFMA" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512ifma" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("avx512vbmi" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512vbmi" "QT_COMPILER_SUPPORTS_AVX512VBMI" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("avx512vbmi" QMAKE_PRIVATE_CONFIG)
|
2022-02-24 01:54:40 +00:00
|
|
|
qt_feature("avx512vbmi2" PRIVATE
|
|
|
|
LABEL "AVX512VBMI2"
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin AND TEST_subarch_avx512vbmi2
|
2022-02-24 01:54:40 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("avx512vbmi2" "QT_COMPILER_SUPPORTS_AVX512VBMI2" VALUE "1")
|
|
|
|
qt_feature_config("avx512vbmi2" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("aesni" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("aesni" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("aesni" QMAKE_PRIVATE_CONFIG)
|
2022-02-24 01:54:40 +00:00
|
|
|
qt_feature("vaes" PRIVATE
|
|
|
|
LABEL "VAES"
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin AND TEST_subarch_vaes
|
2022-02-24 01:54:40 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("vaes" "QT_COMPILER_SUPPORTS_VAES" VALUE "1")
|
|
|
|
qt_feature_config("vaes" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("rdrnd" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("rdrnd" "QT_COMPILER_SUPPORTS_RDRND" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("rdrnd" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("rdseed" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2019-10-11 14:55:55 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("rdseed" "QT_COMPILER_SUPPORTS_RDSEED" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("rdseed" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("shani" PRIVATE
|
2022-02-24 02:03:40 +00:00
|
|
|
CONDITION QT_FEATURE_x86intrin
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("shani" "QT_COMPILER_SUPPORTS_SHA" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("shani" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("mips_dsp" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "DSP"
|
2019-03-21 12:14:09 +00:00
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_arch_${TEST_architecture_arch}_subarch_dsp
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("mips_dsp" "QT_COMPILER_SUPPORTS_MIPS_DSP" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("mips_dsp" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("mips_dspr2" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "DSPr2"
|
2019-03-21 12:14:09 +00:00
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_arch_${TEST_architecture_arch}_subarch_dspr2
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("mips_dspr2" "QT_COMPILER_SUPPORTS_MIPS_DSPR2" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("mips_dspr2" QMAKE_PRIVATE_CONFIG)
|
2021-03-31 16:56:59 +00:00
|
|
|
qt_feature("neon" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "NEON"
|
2023-04-12 15:38:29 +00:00
|
|
|
CONDITION ( ( ( TEST_architecture_arch STREQUAL arm ) OR
|
|
|
|
( TEST_architecture_arch STREQUAL arm64 ) ) AND
|
|
|
|
TEST_arch_${TEST_architecture_arch}_subarch_neon ) OR QT_FORCE_FEATURE_neon
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("neon" "QT_COMPILER_SUPPORTS_NEON" VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("neon" QMAKE_PRIVATE_CONFIG)
|
2021-04-21 09:33:44 +00:00
|
|
|
qt_feature("arm_crc32" PRIVATE
|
|
|
|
LABEL "CRC32"
|
|
|
|
CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_arch_${TEST_architecture_arch}_subarch_crc32
|
|
|
|
)
|
|
|
|
qt_feature_definition("arm_crc32" "QT_COMPILER_SUPPORTS_CRC32" VALUE "1")
|
|
|
|
qt_feature_config("arm_crc32" QMAKE_PRIVATE_CONFIG)
|
|
|
|
qt_feature("arm_crypto" PRIVATE
|
|
|
|
LABEL "AES"
|
|
|
|
CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_arch_${TEST_architecture_arch}_subarch_crypto
|
|
|
|
)
|
|
|
|
qt_feature_definition("arm_crypto" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
|
|
|
|
qt_feature_config("arm_crypto" QMAKE_PRIVATE_CONFIG)
|
2022-10-07 10:00:22 +00:00
|
|
|
|
2022-12-21 13:22:59 +00:00
|
|
|
qt_feature("wasm-simd128" PUBLIC
|
2022-10-07 10:00:22 +00:00
|
|
|
LABEL "WebAssembly SIMD128"
|
2022-12-21 13:22:59 +00:00
|
|
|
PURPOSE "Enables WebAssembly SIMD"
|
2022-10-07 10:00:22 +00:00
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
2022-12-21 13:22:59 +00:00
|
|
|
qt_feature_definition("wasm-simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1")
|
|
|
|
qt_feature_config("wasm-simd128" QMAKE_PRIVATE_CONFIG)
|
|
|
|
|
|
|
|
qt_feature("wasm-exceptions" PUBLIC
|
|
|
|
LABEL "WebAssembly Exceptions"
|
|
|
|
PURPOSE "Enables WebAssembly Exceptions"
|
|
|
|
AUTODETECT OFF
|
|
|
|
)
|
|
|
|
qt_feature_definition("wasm-exceptions" "QT_WASM_EXCEPTIONS" VALUE "1")
|
|
|
|
qt_feature_config("wasm-exceptions" QMAKE_PRIVATE_CONFIG)
|
2022-10-07 10:00:22 +00:00
|
|
|
|
2020-03-24 15:29:54 +00:00
|
|
|
qt_feature("posix_fallocate" PRIVATE
|
|
|
|
LABEL "POSIX fallocate()"
|
|
|
|
CONDITION TEST_posix_fallocate
|
|
|
|
)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("alloca_h" PRIVATE
|
|
|
|
LABEL "alloca.h"
|
|
|
|
CONDITION TEST_alloca_h
|
|
|
|
)
|
|
|
|
qt_feature("alloca_malloc_h" PRIVATE
|
|
|
|
LABEL "alloca() in malloc.h"
|
|
|
|
CONDITION NOT QT_FEATURE_alloca_h AND TEST_alloca_malloc_h
|
|
|
|
)
|
|
|
|
qt_feature("alloca" PRIVATE
|
|
|
|
LABEL "alloca()"
|
|
|
|
CONDITION QT_FEATURE_alloca_h OR QT_FEATURE_alloca_malloc_h OR TEST_alloca_stdlib_h
|
|
|
|
)
|
2020-02-26 09:39:47 +00:00
|
|
|
qt_feature("stack-protector-strong" PRIVATE
|
|
|
|
LABEL "stack protection"
|
|
|
|
CONDITION QNX AND TEST_stack_protector
|
|
|
|
)
|
CMake: Allow building bundled 3rd party libraries in qtbase
A few things are needed to accomplish that:
- the python scripts do not ignore certain system_foo features anymore
(it is a hardcoded list for now just to be safe)
- configurejson2cmake now outputs
qt_find_package(WrapSystemFoo) calls for bundled libraries
(see below)
- the harfbuzz .pro file is modified to accommodate pro2cmake
not being able to correctly parse some conditional scopes
- the freetype .pro file is modified to make sure linking of the
library succeeds without duplicate symbol errors, which qmake
doesn't encounter due to magical exclusion of cpp files that are
included in other cpp files (presumably for include moc_foo.cpp
support)
- feature evaluation for Core, Gui, Network now happens in the
qtbase/src directory, so that bundled libraries can be conditionally
built
- for each bundled library there are now two FindWrap scripts:
- FindWrapSystemFoo which finds an installed library in the system
- FindWrapFoo which either uses the system installed library or
the built bundled one depending on a condition
- projects that intend to use bundled libraries need to link against
WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets
(this is handled by pro2cmake).
Unfortunately manually added qt_find_package(WrapFoo) calls might
still be needed as is the case for WrapFreetype and others.
- a new cmake/QtFindWrapHelper.cmake file is added that provides
a macro to simplify creation of WrapFoo targets that link against
a bundled or system library. The implementation is fairly ugly
due to CMake macro constraints, but it was deemed better than
copy-pasting a bunch of almost identical code across all
FindWrapFoo.cmake files.
- a qtzlib header-only module is now created when using bundled
zlib, to provide public syncqt created headers for consumers
that need them. These are projects that have
'QT_PRIVATE += zlib-private' in their .pro files
(e.g. qtimageformats, qtlocation, qt3d, etc.)
This is unfortunately needed due to QtNetwork using zlib
types in its private C++ API.
The change includes support for building the following bundled
libraries:
- zlib
- libpng
- libjpeg
- Freetype
- Harfbuzz-ng
- PCRE2
The following 3rd party libraries are still using an old
implementation within the CMake build system, and should be migrated
to the new one in the near future:
- double-conversion
- Old harfbuzz
The are a few libraries that are not yet ported:
- system-sqlite
- systemxcb
- maybe others
Among other things, this change allows building qtbase on Windows
without requiring vcpkg.
Task-number: QTBUG-82167
Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-02-14 13:53:28 +00:00
|
|
|
qt_feature("system-zlib" PRIVATE
|
|
|
|
LABEL "Using system zlib"
|
2022-03-31 10:41:13 +00:00
|
|
|
CONDITION WrapSystemZLIB_FOUND
|
CMake: Allow building bundled 3rd party libraries in qtbase
A few things are needed to accomplish that:
- the python scripts do not ignore certain system_foo features anymore
(it is a hardcoded list for now just to be safe)
- configurejson2cmake now outputs
qt_find_package(WrapSystemFoo) calls for bundled libraries
(see below)
- the harfbuzz .pro file is modified to accommodate pro2cmake
not being able to correctly parse some conditional scopes
- the freetype .pro file is modified to make sure linking of the
library succeeds without duplicate symbol errors, which qmake
doesn't encounter due to magical exclusion of cpp files that are
included in other cpp files (presumably for include moc_foo.cpp
support)
- feature evaluation for Core, Gui, Network now happens in the
qtbase/src directory, so that bundled libraries can be conditionally
built
- for each bundled library there are now two FindWrap scripts:
- FindWrapSystemFoo which finds an installed library in the system
- FindWrapFoo which either uses the system installed library or
the built bundled one depending on a condition
- projects that intend to use bundled libraries need to link against
WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets
(this is handled by pro2cmake).
Unfortunately manually added qt_find_package(WrapFoo) calls might
still be needed as is the case for WrapFreetype and others.
- a new cmake/QtFindWrapHelper.cmake file is added that provides
a macro to simplify creation of WrapFoo targets that link against
a bundled or system library. The implementation is fairly ugly
due to CMake macro constraints, but it was deemed better than
copy-pasting a bunch of almost identical code across all
FindWrapFoo.cmake files.
- a qtzlib header-only module is now created when using bundled
zlib, to provide public syncqt created headers for consumers
that need them. These are projects that have
'QT_PRIVATE += zlib-private' in their .pro files
(e.g. qtimageformats, qtlocation, qt3d, etc.)
This is unfortunately needed due to QtNetwork using zlib
types in its private C++ API.
The change includes support for building the following bundled
libraries:
- zlib
- libpng
- libjpeg
- Freetype
- Harfbuzz-ng
- PCRE2
The following 3rd party libraries are still using an old
implementation within the CMake build system, and should be migrated
to the new one in the near future:
- double-conversion
- Old harfbuzz
The are a few libraries that are not yet ported:
- system-sqlite
- systemxcb
- maybe others
Among other things, this change allows building qtbase on Windows
without requiring vcpkg.
Task-number: QTBUG-82167
Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-02-14 13:53:28 +00:00
|
|
|
)
|
2022-07-05 12:34:31 +00:00
|
|
|
qt_feature("zstd" PUBLIC
|
2019-04-16 14:32:08 +00:00
|
|
|
LABEL "Zstandard support"
|
2022-02-23 11:29:08 +00:00
|
|
|
CONDITION WrapZSTD_FOUND
|
2019-04-16 14:32:08 +00:00
|
|
|
)
|
2021-12-14 08:38:29 +00:00
|
|
|
qt_feature("stdlib-libcpp" PRIVATE
|
|
|
|
LABEL "Using stdlib=libc++"
|
|
|
|
AUTODETECT OFF
|
2023-08-22 11:17:46 +00:00
|
|
|
CONDITION MINGW OR (LINUX AND NOT ANDROID)
|
2021-12-14 08:38:29 +00:00
|
|
|
)
|
2021-04-15 14:41:02 +00:00
|
|
|
# Check whether CMake was built with zstd support.
|
|
|
|
# See https://gitlab.kitware.com/cmake/cmake/-/issues/21552
|
|
|
|
if(NOT DEFINED CACHE{QT_CMAKE_ZSTD_SUPPORT})
|
|
|
|
set(QT_CMAKE_ZSTD_SUPPORT FALSE CACHE INTERNAL "")
|
|
|
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
|
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-P "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/cmake_zstd/check_zstd.cmake"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/config.tests"
|
|
|
|
OUTPUT_QUIET ERROR_QUIET
|
|
|
|
RESULT_VARIABLE qt_check_zstd_exit_code)
|
|
|
|
if(qt_check_zstd_exit_code EQUAL 0)
|
|
|
|
set(QT_CMAKE_ZSTD_SUPPORT TRUE CACHE INTERNAL "")
|
|
|
|
endif()
|
|
|
|
unset(qt_check_zstd_exit_code)
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("thread" PUBLIC
|
|
|
|
SECTION "Kernel"
|
|
|
|
LABEL "Thread support"
|
|
|
|
PURPOSE "Provides QThread and related classes."
|
2019-04-16 14:32:08 +00:00
|
|
|
AUTODETECT NOT WASM
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature("future" PUBLIC
|
|
|
|
SECTION "Kernel"
|
|
|
|
LABEL "QFuture"
|
|
|
|
PURPOSE "Provides QFuture and related classes."
|
|
|
|
CONDITION QT_FEATURE_thread
|
|
|
|
)
|
|
|
|
qt_feature("concurrent" PUBLIC
|
|
|
|
SECTION "Kernel"
|
|
|
|
LABEL "Qt Concurrent"
|
|
|
|
PURPOSE "Provides a high-level multi-threading API."
|
|
|
|
CONDITION QT_FEATURE_future
|
|
|
|
)
|
|
|
|
qt_feature_definition("concurrent" "QT_NO_CONCURRENT" NEGATE VALUE "1")
|
|
|
|
qt_feature("dbus" PUBLIC PRIVATE
|
|
|
|
LABEL "Qt D-Bus"
|
2020-06-05 07:24:37 +00:00
|
|
|
AUTODETECT NOT UIKIT AND NOT ANDROID
|
2020-09-03 08:29:41 +00:00
|
|
|
CONDITION QT_FEATURE_thread AND NOT WASM
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
|
|
|
qt_feature_definition("dbus" "QT_NO_DBUS" NEGATE VALUE "1")
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature("dbus-linked" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Qt D-Bus directly linked to libdbus"
|
2019-05-03 13:02:32 +00:00
|
|
|
CONDITION QT_FEATURE_dbus AND DBus1_FOUND
|
2018-10-24 13:20:27 +00:00
|
|
|
ENABLE INPUT_dbus STREQUAL 'linked'
|
|
|
|
DISABLE INPUT_dbus STREQUAL 'runtime'
|
|
|
|
)
|
2020-08-18 08:59:03 +00:00
|
|
|
qt_feature("qreal"
|
|
|
|
LABEL "Type for qreal"
|
|
|
|
CONDITION DEFINED QT_COORD_TYPE AND NOT QT_COORD_TYPE STREQUAL "double"
|
|
|
|
)
|
|
|
|
qt_feature_definition("qreal" "QT_COORD_TYPE" VALUE "${QT_COORD_TYPE}")
|
|
|
|
qt_feature_definition("qreal" "QT_COORD_TYPE_STRING" VALUE "\"${QT_COORD_TYPE}\"")
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("gui" PRIVATE
|
|
|
|
LABEL "Qt Gui"
|
|
|
|
)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("gui" QMAKE_PUBLIC_QT_CONFIG
|
|
|
|
NEGATE)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("network" PRIVATE
|
|
|
|
LABEL "Qt Network"
|
|
|
|
)
|
2021-02-02 10:51:59 +00:00
|
|
|
qt_feature("printsupport" PRIVATE
|
|
|
|
LABEL "Qt PrintSupport"
|
|
|
|
CONDITION QT_FEATURE_widgets
|
|
|
|
)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("sql" PRIVATE
|
|
|
|
LABEL "Qt Sql"
|
|
|
|
)
|
|
|
|
qt_feature("testlib" PRIVATE
|
|
|
|
LABEL "Qt Testlib"
|
|
|
|
)
|
2019-03-14 12:22:09 +00:00
|
|
|
qt_feature("widgets" PRIVATE
|
2018-10-24 13:20:27 +00:00
|
|
|
LABEL "Qt Widgets"
|
2020-03-16 12:36:47 +00:00
|
|
|
AUTODETECT NOT TVOS AND NOT WATCHOS
|
2018-10-24 13:20:27 +00:00
|
|
|
CONDITION QT_FEATURE_gui
|
|
|
|
)
|
|
|
|
qt_feature_definition("widgets" "QT_NO_WIDGETS" NEGATE)
|
2019-11-29 18:45:38 +00:00
|
|
|
qt_feature_config("widgets" QMAKE_PUBLIC_QT_CONFIG
|
|
|
|
NEGATE)
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_feature("xml" PRIVATE
|
|
|
|
LABEL "Qt Xml"
|
|
|
|
)
|
|
|
|
qt_feature("libudev" PRIVATE
|
|
|
|
LABEL "udev"
|
2021-07-02 07:40:59 +00:00
|
|
|
CONDITION Libudev_FOUND AND NOT INTEGRITY
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
2021-11-04 14:59:17 +00:00
|
|
|
qt_feature("openssl" PRIVATE
|
|
|
|
LABEL "OpenSSL"
|
|
|
|
CONDITION QT_FEATURE_openssl_runtime OR QT_FEATURE_openssl_linked
|
|
|
|
ENABLE false
|
|
|
|
)
|
|
|
|
qt_feature_definition("openssl" "QT_NO_OPENSSL" NEGATE)
|
|
|
|
qt_feature_config("openssl" QMAKE_PUBLIC_QT_CONFIG)
|
|
|
|
qt_feature("openssl-runtime"
|
|
|
|
AUTODETECT NOT WASM
|
|
|
|
CONDITION TEST_opensslv11_headers OR TEST_opensslv30_headers
|
|
|
|
ENABLE INPUT_openssl STREQUAL 'yes' OR INPUT_openssl STREQUAL 'runtime'
|
|
|
|
DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_openssl STREQUAL 'linked' OR INPUT_ssl STREQUAL 'no'
|
|
|
|
)
|
2022-09-27 10:28:39 +00:00
|
|
|
qt_feature("openssl-linked" PUBLIC
|
2021-11-04 14:59:17 +00:00
|
|
|
LABEL " Qt directly linked to OpenSSL"
|
|
|
|
AUTODETECT OFF
|
|
|
|
CONDITION TEST_opensslv11 OR TEST_opensslv30
|
|
|
|
ENABLE INPUT_openssl STREQUAL 'linked'
|
|
|
|
)
|
|
|
|
qt_feature_definition("openssl-linked" "QT_LINKED_OPENSSL")
|
|
|
|
qt_feature("opensslv11" PUBLIC
|
|
|
|
LABEL "OpenSSL 1.1"
|
|
|
|
CONDITION TEST_opensslv11 OR TEST_opensslv11_headers
|
2022-11-17 18:38:53 +00:00
|
|
|
DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_ssl STREQUAL 'no'
|
2021-11-04 14:59:17 +00:00
|
|
|
)
|
|
|
|
qt_feature("opensslv30" PUBLIC
|
|
|
|
LABEL "OpenSSL 3.0"
|
|
|
|
CONDITION TEST_opensslv30 OR TEST_opensslv30_headers
|
2022-11-17 18:38:53 +00:00
|
|
|
DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_ssl STREQUAL 'no'
|
2021-11-04 14:59:17 +00:00
|
|
|
)
|
2020-04-17 06:56:26 +00:00
|
|
|
qt_feature("ccache"
|
|
|
|
LABEL "Using ccache"
|
|
|
|
AUTODETECT 1
|
|
|
|
CONDITION QT_USE_CCACHE
|
|
|
|
)
|
|
|
|
qt_feature_config("ccache" QMAKE_PRIVATE_CONFIG)
|
2020-04-17 15:12:40 +00:00
|
|
|
qt_feature("static_runtime"
|
|
|
|
LABEL "Statically link the C/C++ runtime library"
|
|
|
|
AUTODETECT OFF
|
|
|
|
CONDITION NOT QT_FEATURE_shared
|
|
|
|
EMIT_IF WIN32
|
|
|
|
)
|
|
|
|
qt_feature_config("static_runtime" QMAKE_PUBLIC_CONFIG)
|
|
|
|
qt_feature_config("static_runtime" QMAKE_PUBLIC_QT_CONFIG)
|
2019-10-11 14:55:55 +00:00
|
|
|
qt_feature("dlopen" PRIVATE
|
|
|
|
LABEL "dlopen()"
|
2021-07-02 07:40:59 +00:00
|
|
|
CONDITION UNIX AND NOT INTEGRITY
|
2019-10-11 14:55:55 +00:00
|
|
|
)
|
|
|
|
qt_feature("relocatable" PRIVATE
|
|
|
|
LABEL "Relocatable"
|
2020-03-01 00:00:23 +00:00
|
|
|
PURPOSE "Enable the Qt installation to be relocated."
|
2019-10-11 14:55:55 +00:00
|
|
|
AUTODETECT QT_FEATURE_shared
|
|
|
|
CONDITION QT_FEATURE_dlopen OR WIN32 OR NOT QT_FEATURE_shared
|
|
|
|
)
|
2020-05-29 17:01:36 +00:00
|
|
|
qt_feature("intelcet" PRIVATE
|
2022-09-20 09:42:39 +00:00
|
|
|
LABEL "Using Intel CET"
|
2021-11-19 02:29:27 +00:00
|
|
|
CONDITION ( INPUT_intelcet STREQUAL yes ) OR TEST_intelcet
|
2020-05-29 17:01:36 +00:00
|
|
|
)
|
2023-09-13 14:31:52 +00:00
|
|
|
|
|
|
|
if("${INPUT_coverage}" STREQUAL "gcov")
|
|
|
|
qt_config_compile_test(gcov
|
|
|
|
LABEL "gcov compiler flags"
|
2023-11-01 10:31:16 +00:00
|
|
|
COMPILE_OPTIONS "--coverage"
|
2023-09-13 14:31:52 +00:00
|
|
|
CODE
|
|
|
|
"int main(void)
|
|
|
|
{
|
|
|
|
/* BEGIN TEST: */
|
|
|
|
/* END TEST: */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
qt_feature("coverage-gcov"
|
|
|
|
LABEL "Gcov"
|
|
|
|
ENABLE INPUT_coverage STREQUAL "gcov"
|
|
|
|
CONDITION TEST_gcov AND
|
|
|
|
( QT_FEATURE_debug OR QT_FEATURE_debug_and_release )
|
|
|
|
)
|
|
|
|
|
|
|
|
qt_feature("coverage"
|
|
|
|
LABEL "Coverage"
|
|
|
|
CONDITION QT_FEATURE_coverage_gcov
|
|
|
|
)
|
|
|
|
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_build_type_and_config()
|
|
|
|
qt_configure_add_summary_section(NAME "Build options")
|
|
|
|
qt_configure_add_summary_build_mode(Mode)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "optimize_debug"
|
|
|
|
CONDITION NOT MSVC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "optimize_size"
|
|
|
|
CONDITION NOT QT_FEATURE_debug OR QT_FEATURE_debug_and_release
|
|
|
|
)
|
2020-10-05 07:09:13 +00:00
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "optimize_full"
|
|
|
|
)
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "shared")
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "ccache"
|
|
|
|
CONDITION UNIX
|
|
|
|
)
|
2023-05-09 11:48:13 +00:00
|
|
|
qt_configure_add_summary_entry(
|
2023-06-27 09:49:04 +00:00
|
|
|
TYPE "message" ARGS "Unity Build" MESSAGE "yes" CONDITION QT_UNITY_BUILD
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
TYPE "message" ARGS "Unity Build" MESSAGE "no" CONDITION NOT QT_UNITY_BUILD
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
TYPE "message"
|
|
|
|
ARGS "Unity Build Batch Size"
|
|
|
|
MESSAGE "${QT_UNITY_BUILD_BATCH_SIZE}"
|
|
|
|
CONDITION QT_UNITY_BUILD
|
2023-05-09 11:48:13 +00:00
|
|
|
)
|
2020-08-20 07:06:16 +00:00
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
TYPE "firstAvailableFeature"
|
2021-12-16 12:25:43 +00:00
|
|
|
ARGS "use_bfd_linker use_gold_linker use_lld_linker use_mold_linker"
|
2020-08-20 07:06:16 +00:00
|
|
|
MESSAGE "Linker"
|
|
|
|
CONDITION QT_FEATURE_use_bfd_linker OR QT_FEATURE_use_gold_linker OR QT_FEATURE_use_lld_linker
|
2021-12-16 12:25:43 +00:00
|
|
|
OR QT_FEATURE_use_mold_linker
|
2020-08-20 07:06:16 +00:00
|
|
|
)
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "enable_new_dtags"
|
|
|
|
CONDITION LINUX
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "enable_gdb_index"
|
|
|
|
CONDITION GCC AND NOT CLANG AND ( QT_FEATURE_debug OR QT_FEATURE_force_debug_info OR QT_FEATURE_debug_and_release )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(ARGS "relocatable")
|
|
|
|
qt_configure_add_summary_entry(ARGS "precompile_header")
|
|
|
|
qt_configure_add_summary_entry(ARGS "ltcg")
|
2021-11-19 02:29:27 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "intelcet")
|
2022-10-07 10:00:22 +00:00
|
|
|
qt_configure_add_summary_entry(
|
2022-12-21 13:22:59 +00:00
|
|
|
ARGS "wasm-simd128"
|
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL wasm )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "wasm-exceptions"
|
2022-10-07 10:00:22 +00:00
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL wasm )
|
|
|
|
)
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_section(NAME "Target compiler supports")
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
TYPE "featureList"
|
2022-02-24 02:03:40 +00:00
|
|
|
ARGS "x86intrin vaes avx512vbmi2"
|
|
|
|
MESSAGE "x86 Intrinsics"
|
2020-03-02 17:06:46 +00:00
|
|
|
CONDITION ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
2021-04-21 09:33:44 +00:00
|
|
|
TYPE "featureList"
|
|
|
|
ARGS "neon arm_crc32 arm_crypto"
|
2022-02-24 02:03:40 +00:00
|
|
|
MESSAGE "ARM Extensions"
|
2020-03-02 17:06:46 +00:00
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "mips_dsp"
|
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL mips )
|
|
|
|
)
|
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "mips_dspr2"
|
|
|
|
CONDITION ( TEST_architecture_arch STREQUAL mips )
|
|
|
|
)
|
|
|
|
qt_configure_end_summary_section() # end of "Target compiler supports" section
|
|
|
|
qt_configure_add_summary_section(NAME "Sanitizers")
|
|
|
|
qt_configure_add_summary_entry(ARGS "sanitize_address")
|
|
|
|
qt_configure_add_summary_entry(ARGS "sanitize_thread")
|
|
|
|
qt_configure_add_summary_entry(ARGS "sanitize_memory")
|
|
|
|
qt_configure_add_summary_entry(ARGS "sanitize_fuzzer_no_link")
|
|
|
|
qt_configure_add_summary_entry(ARGS "sanitize_undefined")
|
|
|
|
qt_configure_end_summary_section() # end of "Sanitizers" section
|
2020-03-26 16:28:20 +00:00
|
|
|
qt_configure_add_summary_build_parts("Build parts")
|
CMake: Allow installation of example sources into the Qt prefix
In Qt 5 times, if Qt was configured with -make examples, running
make install would not only build and install the example binaries,
but would also install the example sources into the prefix.
Installation of example sources was not implemented when the Qt 6
build system has switched to using CMake.
There is still a use case for it though, mainly for Qt Creator, which
only shows the examples of a Qt kit if the sources are available.
In contrast to Qt 5, in Qt 6 we will not install example sources
by default. It will be opt in.
To enable installation of examples sources, configure with
configure -make examples -install-examples-sources
or
cmake -DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
The -make examples part is required, otherwise
-install-examples-sources has no effect.
All example sources can be installed by calling
cmake --install . --component examples_sources
in the qt repo build directory.
In a top-level build, per-repo installation can be done using
cmake --install . --component examples_sources_<repo_name>
where repo_name could be 'qtbase'.
A single example's source can be installed by calling
cmake --install . --component examples_sources_<subdir_name>
where subdir_name is the subdirectory name of the example, e.g.
'gallery'.
Implement installation of example sources by hooking into the
qt_internal_add_example command.
This means that all examples in all repos need to be added via
qt_internal_add_example instead of add_subdirectory, to ensure the
sources are installed. The majority of repos already use it.
For testing purposes one can configure with
-DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
-DQT_INTERNAL_NO_CONFIGURE_EXAMPLES=ON to allow testing installation
of examples sources without building them.
Take into account an additional variable called
QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX to allow installation of
example sources into a location different from the example binaries.
As a cleanup, the NAME option that could previously be passed to
qt_internal_add_example_external_project has been removed.
That's because it's never used anywhere and could not have worked
anyway because qt_internal_add_example_in_tree never handled it.
Pick-to: 6.6
Fixes: QTBUG-112135
Change-Id: I52aa5ec643ff7e212276c88d8dd2dfecdbdbeb0d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-08-07 10:15:35 +00:00
|
|
|
if(QT_INSTALL_EXAMPLES_SOURCES)
|
|
|
|
set(_examples_sources_entry_message "yes")
|
|
|
|
else()
|
|
|
|
set(_examples_sources_entry_message "no")
|
|
|
|
endif()
|
|
|
|
qt_configure_add_summary_entry(ARGS "Install examples sources" TYPE "message"
|
|
|
|
MESSAGE "${_examples_sources_entry_message}")
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(
|
|
|
|
ARGS "appstore-compliant"
|
2020-06-05 07:24:37 +00:00
|
|
|
CONDITION APPLE OR ANDROID OR WIN32
|
2020-03-02 17:06:46 +00:00
|
|
|
)
|
|
|
|
qt_configure_end_summary_section() # end of "Build options" section
|
|
|
|
qt_configure_add_summary_section(NAME "Qt modules and options")
|
|
|
|
qt_configure_add_summary_entry(ARGS "concurrent")
|
|
|
|
qt_configure_add_summary_entry(ARGS "dbus")
|
|
|
|
qt_configure_add_summary_entry(ARGS "dbus-linked")
|
|
|
|
qt_configure_add_summary_entry(ARGS "gui")
|
|
|
|
qt_configure_add_summary_entry(ARGS "network")
|
2021-09-01 08:40:14 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "printsupport")
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "sql")
|
|
|
|
qt_configure_add_summary_entry(ARGS "testlib")
|
|
|
|
qt_configure_add_summary_entry(ARGS "widgets")
|
|
|
|
qt_configure_add_summary_entry(ARGS "xml")
|
|
|
|
qt_configure_end_summary_section() # end of "Qt modules and options" section
|
|
|
|
qt_configure_add_summary_section(NAME "Support enabled for")
|
|
|
|
qt_configure_add_summary_entry(ARGS "pkg-config")
|
2023-06-22 15:38:39 +00:00
|
|
|
|
|
|
|
if(QT_USE_VCPKG AND (DEFINED ENV{VCPKG_ROOT} OR VCPKG_TARGET_TRIPLET))
|
|
|
|
set(_vcpkg_entry_message "yes")
|
|
|
|
else()
|
|
|
|
set(_vcpkg_entry_message "no")
|
|
|
|
endif()
|
|
|
|
qt_configure_add_summary_entry(ARGS "Using vcpkg" TYPE "message" MESSAGE "${_vcpkg_entry_message}")
|
|
|
|
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "libudev")
|
2021-11-04 14:59:17 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "openssl")
|
|
|
|
qt_configure_add_summary_entry(ARGS "openssl-linked")
|
|
|
|
qt_configure_add_summary_entry(ARGS "opensslv11")
|
|
|
|
qt_configure_add_summary_entry(ARGS "opensslv30")
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "system-zlib")
|
|
|
|
qt_configure_add_summary_entry(ARGS "zstd")
|
2020-09-03 08:29:41 +00:00
|
|
|
qt_configure_add_summary_entry(ARGS "thread")
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_end_summary_section() # end of "Support enabled for" section
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE NOTE
|
|
|
|
MESSAGE "Using static linking will disable the use of dynamically loaded plugins. Make sure to import all needed static plugins, or compile needed modules into the library."
|
|
|
|
CONDITION NOT QT_FEATURE_shared
|
|
|
|
)
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE WARNING
|
|
|
|
MESSAGE "-debug-and-release is only supported on Darwin and Windows platforms. Qt can be built in release mode with separate debug information, so -debug-and-release is no longer necessary."
|
|
|
|
CONDITION INPUT_debug_and_release STREQUAL 'yes' AND NOT APPLE AND NOT WIN32
|
|
|
|
)
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE ERROR
|
|
|
|
MESSAGE "debug-only framework builds are not supported. Configure with -no-framework if you want a pure debug build."
|
|
|
|
CONDITION QT_FEATURE_framework AND QT_FEATURE_debug AND NOT QT_FEATURE_debug_and_release
|
|
|
|
)
|
CMake: Handle automatic rpath embedding correctly
Instead of using CMAKE_INSTALL_RPATH to embed an absolute path
to prefix/libdir into all targets, use the more sophisticated aproach
that qmake does.
For certain targets (modules, plugins, tools) use relative rpaths.
Otherwise embed absolute paths (examples, regular binaries).
Installed tests currently have no rpaths.
On certain platforms rpaths are not used (Windows, Android,
iOS / uikit).
Frameworks, app bundles and shallow bundles should also be handled
correctly.
Additional rpaths can be provided via QT_EXTRA_RPATHS variable
(similar to the -R option that configure takes).
Automatic embedding can be disabled either via QT_FEATURE_rpath=OFF
or QT_DISABLE_RPATH=ON.
Note that installed examples are not relocatable at the moment (due
to always having an absolute path rpath), so this is a missing feature
compared to qmake. This is due to missing information on where
examples will be installed, so a relative rpath can not be computed.
By default a Qt installation is relocatable, so there is no need to
pass -DQT_EXTRA_RPATHS=. like Coin used to do with qmake e.g. -R .
Relative rpaths will have the appropriate 'relative base' prefixed
to them (e.g $ORIGIN on linux and @loader_path on darwin platforms).
There is currently no support for other platforms that might have a
different 'relative base' than the ones mentioned above.
Any extra rpaths are saved to BuildInternalsExtra which are re-used
when building other repositories.
configurejson2cmake modified to include correct conditions for the
rpath feature.
It's very likely that we will need a new qt_add_internal_app()
function for gui apps that are to be installed to prefix/bin.
For example for Assistant from qttools. Currently such apps
use qt_add_executable().
The distinction is necessary to make sure that relative rpaths are
embedded into apps, but not executables (which tests are part of).
Amends e835a6853b9c0fb7af32798ed8965de3adf0e15b
Task-number: QTBUG-83497
Change-Id: I3510f63c0a59489741116cc8ec3ef6a0a7704f25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-15 16:48:26 +00:00
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE ERROR
|
|
|
|
MESSAGE "Static builds don't support RPATH"
|
|
|
|
CONDITION ( QT_FEATURE_rpath OR QT_EXTRA_RPATHS ) AND NOT QT_FEATURE_shared
|
|
|
|
)
|
2020-03-02 17:06:46 +00:00
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE ERROR
|
|
|
|
MESSAGE "Command line option -sanitize fuzzer-no-link is only supported with clang compilers."
|
|
|
|
CONDITION QT_FEATURE_sanitize_fuzzer_no_link AND NOT CLANG
|
|
|
|
)
|
2022-02-24 02:03:40 +00:00
|
|
|
if (TEST_architecture_arch STREQUAL x86_64 OR TEST_architecture_arch STREQUAL i386)
|
|
|
|
if ((TEST_architecture_arch STREQUAL i386) OR QNX OR WASM)
|
|
|
|
# Warn only
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE WARNING
|
|
|
|
CONDITION (NOT QT_FEATURE_x86intrin)
|
|
|
|
MESSAGE [=[
|
|
|
|
All x86 intrinsics and SIMD support were disabled. If this was in error, check
|
|
|
|
the result of the build in config.tests/x86intrin and report at https://bugreports.qt.io.
|
2022-12-13 16:59:03 +00:00
|
|
|
]=]
|
|
|
|
)
|
|
|
|
elseif (MSVC AND CLANG)
|
|
|
|
# Warn only
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE WARNING
|
|
|
|
CONDITION (NOT QT_FEATURE_x86intrin)
|
|
|
|
MESSAGE [=[
|
|
|
|
x86 intrinsics support is disabled for clang-cl build. This might be necessary due to
|
|
|
|
https://github.com/llvm/llvm-project/issues/53520
|
2022-02-24 02:03:40 +00:00
|
|
|
]=]
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE ERROR
|
|
|
|
CONDITION (NOT QT_FEATURE_x86intrin)
|
|
|
|
MESSAGE [========[
|
|
|
|
x86 intrinsics support missing. Check your compiler settings. If this is an
|
|
|
|
error, report at https://bugreports.qt.io with your compiler ID and version,
|
|
|
|
and this output:
|
|
|
|
|
|
|
|
${TEST_x86intrin_OUTPUT}
|
|
|
|
]========]
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2021-03-15 11:21:55 +00:00
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE ERROR
|
|
|
|
MESSAGE "Setting a library infix is not supported for framework builds."
|
|
|
|
CONDITION QT_FEATURE_framework AND DEFINED QT_LIBINFIX
|
|
|
|
)
|
2020-09-03 08:29:41 +00:00
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE NOTE
|
2021-04-29 14:29:32 +00:00
|
|
|
MESSAGE "Enable thread support"
|
|
|
|
CONDITION QT_FEATURE_thread AND WASM
|
2020-09-03 08:29:41 +00:00
|
|
|
)
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE WARNING
|
2021-06-03 21:07:26 +00:00
|
|
|
MESSAGE "You should use the recommended Emscripten version ${QT_EMCC_RECOMMENDED_VERSION} with this Qt. You have ${EMCC_VERSION}."
|
2020-09-03 08:29:41 +00:00
|
|
|
CONDITION WASM AND NOT ${EMCC_VERSION} MATCHES ${QT_EMCC_RECOMMENDED_VERSION}
|
|
|
|
)
|
|
|
|
if(WASM)
|
|
|
|
qt_extra_definition("QT_EMCC_VERSION" "\"${EMCC_VERSION}\"" PUBLIC)
|
|
|
|
endif()
|
2018-10-24 13:20:27 +00:00
|
|
|
qt_extra_definition("QT_VERSION_STR" "\"${PROJECT_VERSION}\"" PUBLIC)
|
|
|
|
qt_extra_definition("QT_VERSION_MAJOR" ${PROJECT_VERSION_MAJOR} PUBLIC)
|
|
|
|
qt_extra_definition("QT_VERSION_MINOR" ${PROJECT_VERSION_MINOR} PUBLIC)
|
|
|
|
qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC)
|
2023-03-14 12:31:39 +00:00
|
|
|
|
|
|
|
qt_extra_definition("QT_COPYRIGHT" \"${QT_COPYRIGHT}\" PRIVATE)
|
|
|
|
qt_extra_definition("QT_COPYRIGHT_YEAR" \"${QT_COPYRIGHT_YEAR}\" PRIVATE)
|
2023-06-08 12:46:44 +00:00
|
|
|
|
|
|
|
qt_configure_add_report_entry(
|
|
|
|
TYPE WARNING
|
|
|
|
MESSAGE "QT_ALLOW_SYMLINK_IN_PATHS is enabled. This is not recommended, and it may lead to unexpected issues.
|
|
|
|
E.g., When building QtWebEngine, enabling this option may result in build issues in certain platforms.
|
|
|
|
See https://bugreports.qt.io/browse/QTBUG-59769."
|
|
|
|
CONDITION QT_ALLOW_SYMLINK_IN_PATHS
|
|
|
|
)
|