summaryrefslogtreecommitdiffstats
path: root/cmake/QtInternalTargets.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-12-16 18:51:31 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-01-18 14:28:57 +0100
commitd6066d53fa70e1736ca64d468605a4a430644400 (patch)
tree59e93d52ecdc295748972b98afe1b192e5f36d0c /cmake/QtInternalTargets.cmake
parent461f68c5c9a4feadc9805fa0c1efc79010364770 (diff)
CMake: Fix detection of linker availability
Previously we passed flags like -ld-fuse=lld only to compile calls, but not to the link call of a compile test project. Make sure to pass it to the link call instead by using check_cxx_source_compiles + CMAKE_REQUIRED_LINK_OPTIONS instead of check_cxx_compiler_flag. Note the flag that is passed is still via passed via the compiler launcher and not directly to the linker. Remove duplicate flag handling code. Pick-to: 6.2 6.3 Change-Id: I1bf90573904a9df83240b6debfee3cc9e425c6bb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtInternalTargets.cmake')
-rw-r--r--cmake/QtInternalTargets.cmake10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake
index 0eefc63929..693c0eb83f 100644
--- a/cmake/QtInternalTargets.cmake
+++ b/cmake/QtInternalTargets.cmake
@@ -248,13 +248,11 @@ if(DEFINED QT_EXTRA_FRAMEWORKPATHS AND APPLE)
unset(__qt_fw_flags)
endif()
-if(QT_FEATURE_use_gold_linker)
- target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=gold")
-elseif(QT_FEATURE_use_bfd_linker)
- target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=bfd")
-elseif(QT_FEATURE_use_lld_linker)
- target_link_options(PlatformCommonInternal INTERFACE "-fuse-ld=lld")
+qt_internal_get_active_linker_flags(__qt_internal_active_linker_flags)
+if(__qt_internal_active_linker_flags)
+ target_link_options(PlatformCommonInternal INTERFACE "${__qt_internal_active_linker_flags}")
endif()
+unset(__qt_internal_active_linker_flags)
if(QT_FEATURE_enable_gdb_index)
target_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index")