-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ndk-build is stupid and tries to compile any .cpp file in src #621
Comments
As a detail, the problem is at builds/android/jni/src/Android.mk which uses wildcards. |
Is this one fixed with the updated build? |
Nope |
Does this bug still exist in 2019? |
Yes, and this also affects most dedicated ports with Makefiles. Will vanish when this has been adapted to cmake. |
ndk-build is very likely the last one which is going to be adopted to CMake because nobody wants to understand how the interaction between gradle and CMake works. |
Needed changes so far: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b7d4a31..47c0c212 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -389,6 +389,11 @@ if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "/utf-8")
endif()
+if(ANDROID)
+ target_compile_definitions(${PROJECT_NAME} PUBLIC SDL_MAIN_HANDLED=1)
+ target_link_libraries(${PROJECT_NAME} "GLESv1_CM" "log" "atomic")
+endif()
+
# Executable
# Windows: Only open console for Debug builds
if(CMAKE_BUILD_TYPE MATCHES "Debug")
diff --git a/builds/cmake/Modules/FindSDL2.cmake b/builds/cmake/Modules/FindSDL2.cmake
index 4784a72a..55c77f41 100644
--- a/builds/cmake/Modules/FindSDL2.cmake
+++ b/builds/cmake/Modules/FindSDL2.cmake
@@ -125,7 +125,7 @@ if(WIN32 AND SDL2_LIBRARY)
endif()
-if(WIN32 OR ANDROID OR IOS OR (APPLE AND NOT _sdl2_framework))
+if(WIN32 OR IOS OR (APPLE AND NOT _sdl2_framework))
set(SDL2_EXTRA_REQUIRED SDL2_SDLMAIN_LIBRARY)
find_library(SDL2_SDLMAIN_LIBRARY
NAMES
@@ -256,6 +256,8 @@ if(SDL2_FOUND)
${IOKIT} ${FORCEFEEDBACK} ${CARBON_LIBRARY}
${COREAUDIO} ${AUDIOTOOLBOX} ${AUDIOUNIT} ${METAL}
${ICONV_LIBRARY})
+ elseif(ANDROID)
+ # nothing to do?!
else()
# Remove -lSDL2 -lSDL2main from the pkg-config linker line,
# to prevent linking against the system library |
To build set EASYRPG_TOOLCHAIN_DIR and EASYRPG_LIBLCF_DIR to the paths that contain all the Android toolchains. Then run "gradle assembleRelease" and the magic happens. Fix EasyRPG#621
Maybe ndk-build should depend on a list like all other sane build systems and stop compiling my non-clean upd conflict files player.BASE.cpp because they end on .cpp -.-
The text was updated successfully, but these errors were encountered: