gl_engine: improve the dependency check

- dependency() works with a pkgconfig, more preferred.
- add fallback to GL library search with candididates.
This commit is contained in:
Hermet Park 2024-06-20 13:35:38 +09:00 committed by Hermet Park
parent b79e8d5f24
commit 0c8fe81072

View file

@ -21,10 +21,27 @@ source_file = [
'tvgGlTessellator.h',
]
#find a gl library with fallbacks
gles_dep = meson.get_compiler('cpp').find_library('GLESv3', required: false)
if not gles_dep.found()
gles_dep = meson.get_compiler('cpp').find_library('GLESv2', required: true)
gles_dep = dependency('GLESv3', required: false)
endif
if not gles_dep.found()
gles_dep = meson.get_compiler('cpp').find_library('GLESv2', required: false)
endif
if not gles_dep.found()
gles_dep = dependency('GLESv2', required: false)
endif
if not gles_dep.found()
gles_dep = dependency('GL')
endif
if not gles_dep.found()
gles_dep = meson.get_compiler('cpp').find_library('GL')
endif
engine_dep += [declare_dependency(