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>
This commit is contained in:
parent
872293ad58
commit
d9da52d561
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user