build - bring back loaders and savers as modules and/or static

so the evas modules able to be static or not was a bit pointless as it
could inline all evas modules (or none) not just the most common or
not, but ecore evas modules were still modules, so it really wasn't
being useful.

image loaders ans savers omn the other hand were *ALL* being
statically built in without exception. this was kind of a regression
in the build system in the move to meson. some were static due to
micro optimizations and performance inlining the most common to save a
little extra loading + linking + page fragmentation for loaders you
are likely to need in most cases as well as save the drity pages from
linking in their dependencies (libgif, libtiff, libwebp and all their
dependencies too etc. etc.). this now brings back the ability to
decide which are static and which are shared modules (not exposed to
the user as options for meson - fixed in meson.build files which i
think is good enough given the purpose of this).

Gbp-Pq: Name 0004-build-bring-back-loaders-and-savers-as-modules-and-o.patch
This commit is contained in:
Carsten Haitzler (Rasterman) 2019-10-05 13:14:39 +01:00 committed by luoyaoming
parent b29313a0a5
commit 4c117a6a60
3 changed files with 89 additions and 54 deletions

View File

@ -1,42 +1,51 @@
evas_image_loaders_file = [
['bmp', []],
['eet', [eet]],
['generic', [rt]],
['gif', [giflib]],
['ico', []],
['jpeg', [jpeg]],
['pmaps', []],
['png', [png]],
['psd', []],
['tga', []],
['tgv', [rg_etc, lz4]],
['tiff', [tiff]],
['wbmp', []],
['webp', [webp]],
['xpm', []],
evas_loader_saver_mod_bmp,
evas_loader_saver_mod_eet,
evas_loader_saver_mod_generic,
evas_loader_saver_mod_gif,
evas_loader_saver_mod_ico,
evas_loader_saver_mod_jpeg,
evas_loader_saver_mod_pmaps,
evas_loader_saver_mod_png,
evas_loader_saver_mod_psd,
evas_loader_saver_mod_tga,
evas_loader_saver_mod_tgv,
evas_loader_saver_mod_tiff,
evas_loader_saver_mod_wbmp,
evas_loader_saver_mod_webp,
evas_loader_saver_mod_xpm
]
foreach loader_inst : evas_image_loaders_file
loader = loader_inst[0]
loader_deps = loader_inst[1]
loader = loader_inst[0]
loader_type = loader_inst[1]
loader_deps = loader_inst[2]
if get_option('evas-loaders-disabler').contains(loader) == false
file = join_paths(loader, 'evas_image_load_'+loader+'.c')
tmp = static_library('image_loader_'+loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps
)
evas_static_list += [declare_dependency(
sources: file,
dependencies: loader_deps,
)]
config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
config_h.set('BUILD_LOADER_'+loader.to_upper(), '1')
file = join_paths(loader, 'evas_image_load_'+loader+'.c')
if loader_type == 'shared'
evas_package_modules = join_paths(dir_lib, 'evas', 'modules')
mod_install_dir = join_paths(evas_package_modules, 'image_loaders', loader, version_name)
shared_module(loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
)
module_files += join_paths(mod_install_dir, 'lib'+loader + '.' + sys_mod_extension)
else
config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
tmp = static_library('image_loader_'+loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps
)
evas_static_list += [declare_dependency(
sources: file,
dependencies: loader_deps,
)]
endif
else
message('Image loader '+loader+' disabled')
endif
endforeach
endforeach

View File

@ -1,31 +1,41 @@
evas_image_savers_file = [
['eet', [eet]],
['jpeg', [jpeg]],
['png', [png]],
['tgv', [rg_etc, lz4]],
['tiff', [tiff]],
['webp', []]
evas_loader_saver_mod_eet,
evas_loader_saver_mod_jpeg,
evas_loader_saver_mod_png,
evas_loader_saver_mod_tgv,
evas_loader_saver_mod_tiff,
evas_loader_saver_mod_webp
]
foreach loader_inst : evas_image_savers_file
loader = loader_inst[0]
loader_deps = loader_inst[1]
loader_type = loader_inst[1]
loader_deps = loader_inst[2]
if get_option('evas-loaders-disabler').contains(loader) == false
config_h.set('BUILD_LOADER_'+loader.to_upper(), '1')
file = join_paths(loader, 'evas_image_save_'+loader+'.c')
tmp = static_library('image_saver_'+loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps
)
evas_static_list += [declare_dependency(
sources: file,
dependencies: loader_deps,
)]
config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
if loader_type == 'shared'
evas_package_modules = join_paths(dir_lib, 'evas', 'modules')
mod_install_dir = join_paths(evas_package_modules, 'image_savers', loader, version_name)
shared_module(loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
)
module_files += join_paths(mod_install_dir, 'lib'+loader + '.' + sys_mod_extension)
else
config_h.set('EVAS_STATIC_BUILD_'+loader.to_upper(), '1')
tmp = static_library('image_saver_'+loader, file,
include_directories : config_dir,
dependencies : [evas_pre] + loader_deps
)
evas_static_list += [declare_dependency(
sources: file,
dependencies: loader_deps,
)]
endif
else
message('Image saver '+loader+' disabled')
endif

View File

@ -5,6 +5,22 @@ giflib = cc.find_library('gif')
json = dependency('rlottie', required: get_option('evas-loaders-disabler').contains('json') == false)
webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false)
evas_loader_saver_mod_bmp = ['bmp', 'shared', []]
evas_loader_saver_mod_eet = ['eet', 'static', [eet]]
evas_loader_saver_mod_generic = ['generic', 'shared', [rt]]
evas_loader_saver_mod_gif = ['gif', 'shared', [giflib]]
evas_loader_saver_mod_ico = ['ico', 'shared', []]
evas_loader_saver_mod_jpeg = ['jpeg', 'static', [jpeg]]
evas_loader_saver_mod_pmaps = ['pmaps', 'shared', []]
evas_loader_saver_mod_png = ['png', 'static', [png]]
evas_loader_saver_mod_psd = ['psd', 'shared', []]
evas_loader_saver_mod_tga = ['tga', 'shared', []]
evas_loader_saver_mod_tgv = ['tgv', 'shared', [rg_etc, lz4]]
evas_loader_saver_mod_tiff = ['tiff', 'shared', [tiff]]
evas_loader_saver_mod_wbmp = ['wbmp', 'shared', []]
evas_loader_saver_mod_webp = ['webp', 'shared', [webp]]
evas_loader_saver_mod_xpm = ['xpm', 'shared', []]
#there are a few modules that should NEVER be build as a module but rather be build as static lib and linked in later
evas_static_list = []