diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-26 16:19:13 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-02 18:32:51 +0000 |
commit | d9da52d5616fed6f1d48422d82f23ad3dae946a9 (patch) | |
tree | 5389fa05125b9ea032be6093981aee7cfda671f9 /src/corelib/Qt6CoreMacros.cmake | |
parent | 872293ad58a1ada2adcd30f8c192c4f1d8692dee (diff) |
Clean up application module visibility on Android
Disable ELF visibility using CMake properties on the shared object
that's supposed to contain main().
Change-Id: I9cdbb2a76ad66cf2742280ddfea47908eaff2370
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index d82a65e4a6..7f40038e4a 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -392,6 +392,12 @@ endif() function(add_qt_gui_executable target) if(ANDROID) add_library("${target}" MODULE ${ARGN}) + # On our qmake builds we do don't compile the executables with + # visibility=hidden. Not having this flag set will cause the + # executable to have main() hidden and can then no longer be loaded + # through dlopen() + set_property(TARGET "${target}" PROPERTY C_VISIBILITY_PRESET default) + set_property(TARGET "${target}" PROPERTY CXX_VISIBILITY_PRESET default) else() add_executable("${target}" WIN32 MACOSX_BUNDLE ${ARGN}) endif() @@ -399,11 +405,6 @@ function(add_qt_gui_executable target) if(ANDROID) qt_android_generate_deployment_settings("${target}") - # On our qmake builds we do don't compile the executables with - # visibility=hidden. Not having this flag set will cause the - # executable to have main() hidden and can then no longer be loaded - # through dlopen() - target_compile_options(${target} PRIVATE -fvisibility=default) endif() endfunction() |