From 93ce4723a7f1b9e1cce6fce0235c121745424458 Mon Sep 17 00:00:00 2001 From: Ravbug Date: Wed, 14 Feb 2024 11:42:52 -0500 Subject: [PATCH] Android: fix naming of shared library --- CMakeLists.txt | 14 ++++++++++---- RavEngine | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09e6835..15a1952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,14 +17,18 @@ 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}" SHARED ${SOURCES}) + add_library("${EXECUTABLE_NAME}" SHARED) else() set(EXECUTABLE_NAME "${PROJECT_NAME}") - add_executable("${EXECUTABLE_NAME}" ${SOURCES}) + add_executable("${EXECUTABLE_NAME}") endif() +target_sources(${EXECUTABLE_NAME} PRIVATE ${SOURCES}) + target_link_libraries("${EXECUTABLE_NAME}" PUBLIC "RavEngine" ) # also adds header includes target_compile_features("${EXECUTABLE_NAME}" PRIVATE cxx_std_20) # require C++20 +#target_link_options("${EXECUTABLE_NAME}" PUBLIC "-Wl,--undefined=SDL_main") + # inform engine about your different assets file(GLOB objects "objects/*.obj" "objects/*.fbx") file(GLOB textures "textures/*") @@ -42,8 +46,10 @@ pack_resources(TARGET "${EXECUTABLE_NAME}" ) if (ANDROID) - # SDL android is hardcoded to load "libmain.so" with no "d" postfix - set_target_properties(${EXECUTABLE_NAME} PROPERTIES DEBUG_POSTFIX "") + set_target_properties(${EXECUTABLE_NAME} PROPERTIES + DEBUG_POSTFIX "" # SDL android is hardcoded to load "libmain.so" with no "d" postfix + ) + #target_link_options(${EXECUTABLE_NAME} PUBLIC "-Wl,--no-gc-sections" "-Wl,--undefined=ignore") endif() # fixup macOS / iOS / tvOS bundle diff --git a/RavEngine b/RavEngine index 7fc2b3a..3d9e105 160000 --- a/RavEngine +++ b/RavEngine @@ -1 +1 @@ -Subproject commit 7fc2b3a778cfcf67da5db05c28638a3e610b03a7 +Subproject commit 3d9e10538857a7af80ee0a1d8ec99d9745006dfd