From 04483c58d92ebbac8f9684a6160017da54f0d38e Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 6 Feb 2023 15:21:43 -0700 Subject: [PATCH] Build sfml-main with position-independent code --- src/SFML/Main/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SFML/Main/CMakeLists.txt b/src/SFML/Main/CMakeLists.txt index babd2b32..9390aa95 100644 --- a/src/SFML/Main/CMakeLists.txt +++ b/src/SFML/Main/CMakeLists.txt @@ -17,6 +17,9 @@ endif() sfml_add_library(sfml-main STATIC SOURCES ${SRC}) if(SFML_OS_ANDROID) + # ensure that linking into shared libraries doesn't fail + set_target_properties(sfml-main PROPERTIES POSITION_INDEPENDENT_CODE ON) + # glad sources target_include_directories(sfml-main SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include") endif()