Skip to content

Commit

Permalink
If TGUI would ever be built statically on Android then it must be com…
Browse files Browse the repository at this point in the history
…piled with -fPIC
  • Loading branch information
texus committed Apr 20, 2024
1 parent 62bb888 commit b2e27ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,13 @@ else()
target_include_directories(tgui INTERFACE $<INSTALL_INTERFACE:include>)
endif()

# We need to link to an extra library on android (to use the asset manager)
if(TGUI_OS_ANDROID)
# We need to link to an extra library on android (to use the asset manager)
target_link_libraries(tgui PRIVATE android)

# Always use position-independent code on Android, even when linking statically.
# This is needed because all c++ code is placed in a shared library on Android.
set_target_properties(tgui PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()

# Enable automatic reference counting on iOS
Expand Down

0 comments on commit b2e27ca

Please sign in to comment.