diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-07-12 12:43:27 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-07-13 15:27:23 +0200 |
commit | 564f07086cfeb1ec8065874b4a46a5c5ab904a31 (patch) | |
tree | 6a1297893fd4d52ea3c99ed841a13912fff4ea65 /configure.cmake | |
parent | adfb767bcc21a54e916d99d35c04845e76aae43d (diff) | |
download | qtbase-564f07086cfeb1ec8065874b4a46a5c5ab904a31.tar.gz |
Don't repeat conditions of use_*_linker features in QtFeature.cmake
qt_config_linker_supports() repeated the conditions of all use_*_linker
features, because the features are not evaluated yet when this function
is called, and the function needs to know what linker is used to build Qt.
Move the required tests and features before any
qt_config_linker_supports() call and evaluate the use_*_linker features
early.
Change-Id: I306f032356682a0e82e4d7c4234e5bbc820ab143
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 105 |
1 files changed, 59 insertions, 46 deletions
diff --git a/configure.cmake b/configure.cmake index 6878b8bd55..5f39394d8b 100644 --- a/configure.cmake +++ b/configure.cmake @@ -22,6 +22,65 @@ qt_find_package(WrapDBus1 1.2 PROVIDED_TARGETS dbus-1 MODULE_NAME global QMAKE_L qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev MODULE_NAME global QMAKE_LIB libudev) +#### Early-evaluated, Linker-related Tests and Features + +qt_config_compiler_supports_flag_test(use_bfd_linker + LABEL "bfd linker" + FLAG "-fuse-ld=bfd" + ) + +qt_config_compiler_supports_flag_test(use_gold_linker + LABEL "gold linker" + FLAG "-fuse-ld=gold" + ) + +qt_config_compiler_supports_flag_test(use_lld_linker + LABEL "lld linker" + FLAG "-fuse-ld=lld" + ) + +qt_feature("use_bfd_linker" + PRIVATE + LABEL "bfd" + AUTODETECT false + CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_bfd_linker + ENABLE INPUT_linker STREQUAL 'bfd' + DISABLE INPUT_linker STREQUAL 'gold' OR INPUT_linker STREQUAL 'lld' +) +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' +) +qt_feature_config("use_gold_linker" QMAKE_PRIVATE_CONFIG) + +qt_feature("use_lld_linker" + PRIVATE + LABEL "lld" + AUTODETECT false + CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_lld_linker + ENABLE INPUT_linker STREQUAL 'lld' + DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'gold' +) +qt_feature_config("use_lld_linker" QMAKE_PRIVATE_CONFIG) + +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) +endif() + + #### Tests # machineTuple @@ -98,21 +157,6 @@ qt_config_compile_test(precompile_header PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/precompile_header" ) -qt_config_compiler_supports_flag_test(use_bfd_linker - LABEL "bfd linker" - FLAG "-fuse-ld=bfd" -) - -qt_config_compiler_supports_flag_test(use_gold_linker - LABEL "gold linker" - FLAG "-fuse-ld=gold" -) - -qt_config_compiler_supports_flag_test(use_lld_linker - LABEL "lld linker" - FLAG "-fuse-ld=lld" -) - qt_config_compiler_supports_flag_test(optimize_debug LABEL "-Og support" FLAG "-Og" @@ -360,37 +404,6 @@ qt_feature_config("cross_compile" QMAKE_PRIVATE_CONFIG) qt_feature("gc_binaries" PRIVATE CONDITION NOT QT_FEATURE_shared ) -qt_feature("use_bfd_linker" - PRIVATE # special case - LABEL "bfd" - AUTODETECT false - CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_bfd_linker - ENABLE INPUT_linker STREQUAL 'bfd' - DISABLE INPUT_linker STREQUAL 'gold' OR INPUT_linker STREQUAL 'lld' -) -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 # special case - 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' -) -qt_feature_config("use_gold_linker" QMAKE_PRIVATE_CONFIG) -qt_feature("use_lld_linker" - PRIVATE # special case - LABEL "lld" - AUTODETECT false - CONDITION NOT WIN32 AND NOT INTEGRITY AND NOT WASM AND TEST_use_lld_linker - ENABLE INPUT_linker STREQUAL 'lld' - DISABLE INPUT_linker STREQUAL 'bfd' OR INPUT_linker STREQUAL 'gold' -) -qt_feature_config("use_lld_linker" QMAKE_PRIVATE_CONFIG) qt_feature("optimize_debug" LABEL "Optimize debug build" AUTODETECT NOT QT_FEATURE_developer_build |