summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-06-04 14:09:13 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-04 12:22:30 +0000
commit64c111e10fcb2f69855432177d76649b6b789fac (patch)
treeec60a2571ad2aee42447fb1bc7c727298e5ef1d3 /cmake/QtBuild.cmake
parent624891e7c529e7dd94a26c1786e785a26953e918 (diff)
Android: Use lld as default linker for Qt Modules
We can't use the gold linker with the android NDK, which is the default option. Using the gold linker results in linker crashes. QMake builds also disables the gold linker. Change-Id: I73de93150b160b4411715007bc7e40238b96d400 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index c73e00be47..fab4543b3e 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1240,6 +1240,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
if(NOT ${arg_DISABLE_TOOLS_EXPORT})
qt_export_tools(${target})
endif()
+
+ # We can't use the gold linker on android with the NDK, which is the default
+ # linker. To build our own target we will use the lld linker.
+ if (ANDROID)
+ target_link_options("${target}" PRIVATE -fuse-ld=lld)
+ endif()
endfunction()
function(qt_export_tools module_name)