Skip to content

Commit

Permalink
Fix some issues with Meson build scripts. (Regression from commit ca5…
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerman committed Aug 2, 2024
1 parent ca566eb commit 46990f2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
40 changes: 31 additions & 9 deletions desmume/src/frontend/interface/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
10 changes: 10 additions & 0 deletions desmume/src/frontend/interface/meson_options.txt
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 0 additions & 6 deletions desmume/src/frontend/posix/gtk/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
Expand Down
6 changes: 0 additions & 6 deletions desmume/src/frontend/posix/gtk2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
Expand Down

0 comments on commit 46990f2

Please sign in to comment.