Testing new iOS backend
Hi there!
I’ve just tried to build the game using the tips you gave me. It looked promising but I’ve found plenty of issues. I’m commenting them here but I think we should create a new thread for iOS
First of all, I noticed the whole graalvm thing is for arm64 only like the binary downloaded from liberica-nik (file build/libjglios/third_party/graalvm-host/liberica-nik-23.1.3-macos-aarch64/lib/svm/bin/native-image: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE> ) and the releases at Releases · NostrGameEngine/ios-graal-jdk-21 · GitHub are only arm64 also so as I don’t own a arm based mac but an intel hackintosh I ended up running the build from github actions (buildIosSimulatorApp target). So it would be great if possible to add also x86_64 arch
About the build itself, I’m getting lots of linker errors:
ld: Undefined symbols:
_eglCreateContext, referenced from:
create_context(int) in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
> Task :ios-graalvm:buildIosSimulatorApp FAILED
_eglCreateWindowSurface, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglDestroyContext, referenced from:
_libjglios_egl_shutdown in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglDestroySurface, referenced from:
_libjglios_egl_shutdown in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglGetConfigAttrib, referenced from:
config_attrib(void*, int) in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglGetConfigs, referenced from:
choose_config(int) in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
choose_config(int) in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglGetProcAddress, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glAcquireKeyedMutexWin32EXT in libJGLIOSGLES[2](0-jni_gles.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glActiveShaderProgramEXT in libJGLIOSGLES[2](0-jni_gles.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glActiveTexture in libJGLIOSGLES[2](0-jni_gles.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glAlphaFuncQCOM in libJGLIOSGLES[2](0-jni_gles.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glApplyFramebufferAttachmentCMAAINTEL in libJGLIOSGLES[2](0-jni_gles.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glAttachShader in libJGLIOSGLES[2](0-jni_gles.mm.o)
...
_eglInitialize, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglMakeCurrent, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_make_current in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_shutdown in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglQuerySurface, referenced from:
_libjglios_egl_framebuffer_width in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_framebuffer_height in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglSwapBuffers, referenced from:
_libjglios_egl_swap_buffers in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_eglTerminate, referenced from:
_libjglios_egl_shutdown in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_glGetIntegerv, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_glGetString, referenced from:
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_libjglios_egl_init_with_metal_layer in libJGLIOSCore[3](1-libjglios_ios_launcher.mm.o)
_Java_org_ngengine_libjglios_gles_GLES_glGetString in libJGLIOSGLES[2](0-jni_gles.mm.o)
_glGetStringi, referenced from:
_Java_org_ngengine_libjglios_gles_GLES_glGetStringi in libJGLIOSGLES[2](0-jni_gles.mm.o)
_glMapBufferRange, referenced from:
_Java_org_ngengine_libjglios_gles_GLES_glGetBufferSubData in libJGLIOSGLES[2](0-jni_gles.mm.o)
_glUnmapBuffer, referenced from:
_Java_org_ngengine_libjglios_gles_GLES_glGetBufferSubData in libJGLIOSGLES[2](0-jni_gles.mm.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Apart from the issues I’ve found so far, I have other question, how to add external libraries? For example what if I want to add facebook login or google ads? I also have a custom iOS compilation of libbulletjme for minie in xcframework format, how could I include it to the graalvm library?
Thanks
Discussion in the ATmosphere