From c9c5ca99973e5145f8ecd3759fa00994e41a4904 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 10:08:56 +0200 Subject: [PATCH] Fix linker flag detection on Android Since LINUX is not set when targeting Android, we must extend these conditions manually. Change-Id: Ie78167d452e0806bfa64773c1e311a99f4a28f8c Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 41e33f3857..8b0dfa5c7a 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -441,7 +441,7 @@ function(qt_internal_add_link_flags_no_undefined target) if (GCC OR CLANG) if(APPLE) set(no_undefined_flag "-Wl,-undefined,error") - elseif(LINUX OR MINGW) + elseif(LINUX OR MINGW OR ANDROID) set(no_undefined_flag "-Wl,--no-undefined") else() message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".") @@ -460,7 +460,7 @@ function(qt_internal_add_link_flags_gc_sections target visibility) if (GCC OR CLANG) if(APPLE) set(gc_sections_flag "-Wl,-dead_strip") - elseif(LINUX OR BSD OR SOLARIS OR WIN32) + elseif(LINUX OR BSD OR SOLARIS OR WIN32 OR ANDROID) set(gc_sections_flag "-Wl,--gc-sections") else() message(FATAL_ERROR "Platform linker doesn't support gc sections. Target:\"${target}\".")