infra: add all option to enable all loader formats.

just for developer convenience (including me)

ex) $meson . build -Dloaders="all" ...
This commit is contained in:
Hermet Park 2021-10-06 11:13:49 +09:00 committed by GitHub
parent e7c3a91aa1
commit a2ac28d0c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 14 deletions

View file

@ -20,19 +20,25 @@ if get_option('engines').contains('gl') == true
config_h.set10('THORVG_GL_RASTER_SUPPORT', true) config_h.set10('THORVG_GL_RASTER_SUPPORT', true)
endif endif
if get_option('loaders').contains('svg') == true all_loaders = false
if get_option('loaders').contains('all') == true
all_loaders = true
endif
if all_loaders or get_option('loaders').contains('svg') == true
config_h.set10('THORVG_SVG_LOADER_SUPPORT', true) config_h.set10('THORVG_SVG_LOADER_SUPPORT', true)
endif endif
if get_option('loaders').contains('tvg') == true if all_loaders or get_option('loaders').contains('tvg') == true
config_h.set10('THORVG_TVG_LOADER_SUPPORT', true) config_h.set10('THORVG_TVG_LOADER_SUPPORT', true)
endif endif
if get_option('loaders').contains('png') == true if all_loaders or get_option('loaders').contains('png') == true
config_h.set10('THORVG_PNG_LOADER_SUPPORT', true) config_h.set10('THORVG_PNG_LOADER_SUPPORT', true)
endif endif
if get_option('loaders').contains('jpg') == true if all_loaders or get_option('loaders').contains('jpg') == true
config_h.set10('THORVG_JPG_LOADER_SUPPORT', true) config_h.set10('THORVG_JPG_LOADER_SUPPORT', true)
endif endif
@ -102,10 +108,10 @@ Summary:
simd_type, simd_type,
get_option('engines').contains('sw'), get_option('engines').contains('sw'),
get_option('engines').contains('gl'), get_option('engines').contains('gl'),
get_option('loaders').contains('tvg'), all_loaders or get_option('loaders').contains('tvg'),
get_option('loaders').contains('svg'), all_loaders or get_option('loaders').contains('svg'),
get_option('loaders').contains('png'), all_loaders or get_option('loaders').contains('png'),
get_option('loaders').contains('jpg'), all_loaders or get_option('loaders').contains('jpg'),
get_option('savers').contains('tvg'), get_option('savers').contains('tvg'),
get_option('bindings').contains('capi'), get_option('bindings').contains('capi'),
get_option('log'), get_option('log'),

View file

@ -6,7 +6,7 @@ option('engines',
option('loaders', option('loaders',
type: 'array', type: 'array',
choices: ['', 'tvg', 'svg', 'png', 'jpg'], choices: ['', 'tvg', 'svg', 'png', 'jpg', 'all'],
value: ['svg', 'tvg'], value: ['svg', 'tvg'],
description: 'Enable File Loaders in thorvg') description: 'Enable File Loaders in thorvg')

View file

@ -1,21 +1,21 @@
subloader_dep = [] subloader_dep = []
if get_option('loaders').contains('tvg') == true if all_loaders or get_option('loaders').contains('tvg') == true
subdir('tvg') subdir('tvg')
endif endif
if get_option('loaders').contains('svg') == true if all_loaders or get_option('loaders').contains('svg') == true
subdir('svg') subdir('svg')
endif endif
if get_option('loaders').contains('png') == true if all_loaders or get_option('loaders').contains('png') == true
subdir('external_png') subdir('external_png')
if not png_dep.found() if not png_dep.found()
subdir('png') subdir('png')
endif endif
endif endif
if get_option('loaders').contains('jpg') == true if all_loaders or get_option('loaders').contains('jpg') == true
subdir('external_jpg') subdir('external_jpg')
if not jpg_dep.found() if not jpg_dep.found()
subdir('jpg') subdir('jpg')