summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeature.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-07-12 12:43:27 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-07-13 15:27:23 +0200
commit564f07086cfeb1ec8065874b4a46a5c5ab904a31 (patch)
tree6a1297893fd4d52ea3c99ed841a13912fff4ea65 /cmake/QtFeature.cmake
parentadfb767bcc21a54e916d99d35c04845e76aae43d (diff)
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 'cmake/QtFeature.cmake')
-rw-r--r--cmake/QtFeature.cmake12
1 files changed, 3 insertions, 9 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index e069dad23d..21f84f8e20 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -1046,15 +1046,11 @@ function(qt_config_linker_supports_flag_test name)
# Select the right linker.
if(GCC OR CLANG)
- # TODO: This works for now but is... suboptimal. Once
- # QTBUG-86186 is resolved, we should check the *features*
- # QT_FEATURE_use_gold_linker etc. instead of trying to
- # replicate the feature conditions.
- if(QT_FEATURE_use_gold_linker_alias OR INPUT_linker STREQUAL "gold")
+ if(QT_FEATURE_use_gold_linker)
list(PREPEND flags "-fuse-ld=gold")
- elseif(INPUT_linker STREQUAL "bfd")
+ elseif(QT_FEATURE_use_bfd_linker)
list(PREPEND flags "-fuse-ld=bfd")
- elseif(INPUT_linker STREQUAL "lld")
+ elseif(QT_FEATURE_use_lld_linker)
list(PREPEND flags "-fuse-ld=lld")
endif()
endif()
@@ -1095,5 +1091,3 @@ function(qt_make_features_available target)
endforeach()
endforeach()
endfunction()
-
-