Edit meson scripts to compile for Android

This commit is contained in:
ItzVladik
2026-04-05 08:18:29 +00:00
parent 91923d445a
commit 1ea1801271
5 changed files with 86 additions and 10 deletions
+25 -4
View File
@@ -17,6 +17,8 @@ pymod = import('python')
python = pymod.find_installation('python3', required: true)
cc = meson.get_compiler('cpp')
lib_dir = meson.current_source_dir() / 'thirdparty/lib' / host_machine.system() / host_machine.cpu()
inc_dir = 'thirdparty/include' / host_machine.system()
global_cpp_defs = [
'-DSPLIT_SAVES',
@@ -28,13 +30,21 @@ global_cpp_defs = [
'-DDEBUG',
]
if host_machine.system() == 'linux'
if host_machine.system() == 'linux' or host_machine.system() == 'android'
global_cpp_defs += ['-Dlinux', '-D__linux', '-D__linux__']
endif
if host_machine.system() == 'android'
global_cpp_defs += ['-D__android__']
endif
if get_option('renderer') == 'gles'
global_cpp_defs += ['-DGLES']
gl_dep = dependency('glesv2', required: true)
if host_machine.system() == 'android'
gl_dep = cc.find_library('GLESv3', required: true )
else
gl_dep = dependency('glesv2', required: true)
endif
glu_dep = dependency('', required: false)
else
gl_dep = dependency('gl', required: true)
@@ -69,10 +79,21 @@ global_cpp_args = [
]
add_project_arguments(global_cpp_args, language: 'cpp')
sdl2_dep = dependency('sdl2')
if host_machine.system() == 'android'
sdl2_dep = declare_dependency(
dependencies: cc.find_library('SDL2', dirs: lib_dir, required: true ),
include_directories: inc_dir)
else
sdl2_dep = dependency('sdl2')
endif
thread_dep = dependency('threads')
dl_dep = cc.find_library('dl', required: true)
glm_dep = dependency('glm')
if host_machine.system() == 'android'
glm_dep = declare_dependency(include_directories: inc_dir)
else
glm_dep = dependency('glm')
endif
stb = subproject('stb').get_variable('stb_inc')
stb_dep = declare_dependency(include_directories: stb)