Fix some issues with Meson build scripts. (Regression from commit ca566eb.)

This commit is contained in:
rogerman 2024-08-01 17:51:12 -07:00
parent ca566eb11b
commit 46990f2d85
4 changed files with 41 additions and 21 deletions

View File

@ -15,11 +15,18 @@ dep_sdl = dependency('sdl2')
dep_pcap = dependency('pcap')
dep_zlib = dependency('zlib')
dep_threads = dependency('threads')
dep_gl = dependency('gl', required: false)
dep_openal = dependency('openal', required: get_option('openal'))
dep_alsa = dependency('alsa', required: false)
dep_soundtouch = dependency('soundtouch', required: false)
if host_machine.system() == 'darwin'
dep_gl = dependency('appleframeworks', modules: 'OpenGL')
dep_gles = dependency('appleframeworks', modules: 'OpenGLES')
else
dep_gl = dependency('gl', required: false)
dep_gles = dependency('glesv2', required: false)
endif
if get_option('wifi')
add_global_arguments('-DEXPERIMENTAL_WIFI_COMM', language: ['c', 'cpp'])
endif
@ -173,14 +180,29 @@ if have_jit
]
endif
if host_machine.system() == 'darwin'
dependencies += dependency('appleframeworks', modules: 'OpenGL')
elif dep_gl.found()
dependencies += dep_gl
libdesmume_src += [
'../../OGLRender.cpp',
'../../OGLRender_3_2.cpp',
]
if get_option('opengles')
if dep_gles.found()
add_global_arguments('-DENABLE_OPENGL_ES', language: ['c', 'cpp'])
dependencies += dep_gles
libdesmume_src += [
'../../OGLRender.cpp',
'../../OGLRender_3_2.cpp',
'../../OGLRender_ES3.cpp',
]
else
message('Cannot build with OpenGL ES -- library not found.')
endif
elif get_option('opengl')
if dep_gl.found()
add_global_arguments('-DENABLE_OPENGL_STANDARD', language: ['c', 'cpp'])
dependencies += dep_gl
libdesmume_src += [
'../../OGLRender.cpp',
'../../OGLRender_3_2.cpp',
]
else
message('Cannot build with OpenGL -- library not found.')
endif
endif
if dep_openal.found()

View File

@ -1,3 +1,13 @@
option('opengl',
type: 'boolean',
value: false,
description: 'Build for OpenGL',
)
option('opengles',
type: 'boolean',
value: false,
description: 'Build for OpenGL ES',
)
option('openal',
type: 'boolean',
value: false,

View File

@ -25,20 +25,14 @@ desmume_src = [
]
if get_option('glx') and dep_glx.found()
add_global_arguments('-DENABLE_GLX', language: ['c', 'cpp'])
dependencies += dep_glx
desmume_src += [
'../shared/glx_3Demu.cpp',
]
elif get_option('osmesa') and dep_osmesa.found()
add_global_arguments('-DENABLE_OSMESA', language: ['c', 'cpp'])
dependencies += dep_osmesa
desmume_src += [
'../shared/osmesa_3Demu.cpp',
]
elif get_option('egl') and dep_egl.found()
add_global_arguments('-DENABLE_EGL', language: ['c', 'cpp'])
dependencies += dep_egl
desmume_src += [
'../shared/egl_3Demu.cpp',
]

View File

@ -18,20 +18,14 @@ desmume_src = [
]
if get_option('glx') and dep_glx.found()
add_global_arguments('-DENABLE_GLX', language: ['c', 'cpp'])
dependencies += dep_glx
desmume_src += [
'../shared/glx_3Demu.cpp',
]
elif get_option('osmesa') and dep_osmesa.found()
add_global_arguments('-DENABLE_OSMESA', language: ['c', 'cpp'])
dependencies += dep_osmesa
desmume_src += [
'../shared/osmesa_3Demu.cpp',
]
elif get_option('egl') and dep_egl.found()
add_global_arguments('-DENABLE_EGL', language: ['c', 'cpp'])
dependencies += dep_egl
desmume_src += [
'../shared/egl_3Demu.cpp',
]