Skip to content

Commit

Permalink
Android fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Feb 10, 2024
1 parent e3f7cca commit 84c2cc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ add_subdirectory("RavEngine" EXCLUDE_FROM_ALL) # configure the engine library
file(GLOB SOURCES "*.cpp" "*.hpp" "*.h")
if (ANDROID)
# The SDL java code is hardcoded to load libmain.so on android, so we need to change EXECUTABLE_NAME
# it must also explicitly be a shared library
set(EXECUTABLE_NAME main)
add_library("${EXECUTABLE_NAME}" ${SOURCES})
add_library("${EXECUTABLE_NAME}" SHARED ${SOURCES})
else()
set(EXECUTABLE_NAME "${PROJECT_NAME}")
add_executable("${EXECUTABLE_NAME}" ${SOURCES})
Expand All @@ -40,6 +41,11 @@ pack_resources(TARGET "${EXECUTABLE_NAME}"
SOUNDS ${sounds}
)

if (ANDROID)
# SDL android is hardcoded to load "libmain.so" with no "d" postfix
set_target_properties(${EXECUTABLE_NAME} PROPERTIES DEBUG_POSTFIX "")
endif()

# fixup macOS / iOS / tvOS bundle
# this is important if you use third party libraries that are linked dynamically.
if(APPLE)
Expand Down

0 comments on commit 84c2cc5

Please sign in to comment.