meson: prepare general build for the bindings

for bindings we needed a system that could be used to find all special
directories of every subsystem, for eo files headers etc.
The mechanism is documented in the root meson.build

Differential Revision: https://phab.enlightenment.org/D7180
This commit is contained in:
Marcel Hollerbach 2018-10-19 15:47:44 +02:00
parent 5a3d79d383
commit e19d239147
7 changed files with 73 additions and 23 deletions

View File

@ -58,6 +58,7 @@ dir_lib = join_paths(dir_prefix, get_option('libdir'))
#local paths
local_lib = join_paths('src', 'lib')
local_bindings = join_paths('src', 'bindings')
local_bin = join_paths('src', 'bin')
local_module = join_paths('src', 'modules')
local_tests = join_paths('src', 'tests')
@ -65,18 +66,15 @@ local_benchmark = join_paths('src', 'benchmarks')
local_examples = join_paths('src', 'examples')
local_scripts = join_paths('src', 'scripts')
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
add_global_arguments('-D_GNU_SOURCE=1', language: 'c')
add_global_arguments('-fPIC', language: 'c')
add_global_arguments('-DEFL_EO_API_SUPPORT=1', language: 'c')
add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: 'c')
add_global_arguments('-DNEED_RUN_IN_TREE=1', language: 'c')
add_global_arguments('-DEFL_BUILD=1', language: 'c')
add_global_arguments('-DEFL_BUILD=1', language: 'objc')
add_global_arguments('-DEFL_EO_API_SUPPORT=1', language: 'objc')
add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: 'objc')
add_global_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: 'c')
foreach lang : ['c', 'objc', 'cpp']
add_global_arguments('-DHAVE_CONFIG_H=1', language: lang)
add_global_arguments('-D_GNU_SOURCE=1', language: lang)
add_global_arguments('-DEFL_EO_API_SUPPORT=1', language: lang)
add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: lang)
add_global_arguments('-DNEED_RUN_IN_TREE=1', language: lang)
add_global_arguments('-DEFL_BUILD=1', language: lang)
add_global_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: lang)
endforeach
config_h = configuration_data()
config_h.set_quoted('MODULE_ARCH', version_name)
@ -97,7 +95,6 @@ config_h.set_quoted('PACKAGE_SYSCONF_DIR', dir_sysconf)
config_h.set_quoted('BINDIR', dir_bin)
config_h.set_quoted('DATADIR', dir_data)
config_h.set10('EFL_HAVE_THREADS', true)
config_h.set('NEED_RUN_IN_TREE', '1')
config_dir = [include_directories('.')]
eolian_include_directories = []
@ -229,7 +226,20 @@ foreach package : subprojects
dir_package_modules = join_paths(dir_lib, package_name, 'modules')
#ensure that we really dont copy the eo file targets from a previous library
#Those are the variables that can be used to reflect the libraries speical handlings
# -> at the end is used to indicate where to find this variable outside of this for loop
#public eo and eot files - which probebly have to be used later for bindings
pub_eo_files = [] # -> package_name + '_eo_files'
pub_eo_types_files = [] # -> package_name + '_eot_files'
#All subdirs where eo files that are listed in the pub_* variables can be found
#For every element != '' a variable called package_name + '_' + subir + '_eot_files' and package_name + '_' + subir + '_eo_files' must exist.
package_eo_subdirs = [''] # -> package_name + '_eo_subdirs'
#All subdirs that should be included in order to include every requried header
package_header_subdirs = [] # -> package_name + '_include_subdirs'
#eo file targets, this list of targets can be used to ensure the files are created before accessed
pub_eo_file_target = []
#private eo files target - never use this :)
priv_eo_file_target = []
foreach static_lib : package[9]
@ -239,7 +249,11 @@ foreach package : subprojects
endforeach
if (package[3])
subdir(join_paths(local_lib, package_name))
subdir(join_paths(local_lib, package_name))
set_variable(package_name + '_eo_files', pub_eo_files)
set_variable(package_name + '_eot_files', pub_eo_types_files)
set_variable(package_name + '_header_subdirs', package_header_subdirs)
set_variable(package_name + '_eo_subdirs', package_eo_subdirs)
endif
if (package[2])
subdir(join_paths(local_module, package_name))
@ -264,10 +278,15 @@ foreach package : subprojects
tmp_lib = get_variable(package_name+'_lib')
tmp_deps = get_variable(package_name+'_deps')
tmp_pub_deps = get_variable(package_name+'_pub_deps')
tmp_package_subdirs = []
foreach subdir : package_header_subdirs
tmp_package_subdirs += join_paths(package_version_name, subdir)
endforeach
pkgconfig.generate(tmp_lib,
name : '-'.join(package_name.split('_')),
subdirs : package_version_name,
subdirs : [package_version_name] + tmp_package_subdirs,
version : version_major + '.' + version_minor,
libraries : tmp_pub_deps,
requires : package[8],
@ -275,7 +294,7 @@ foreach package : subprojects
if package_name == 'ethumb_client'
pkgconfig.generate(tmp_lib,
name : package_name,
subdirs : package_version_name,
subdirs : [package_version_name] + tmp_package_subdirs,
version : version_major + '.' + version_minor,
libraries : tmp_pub_deps,
requires : package[8],

View File

@ -119,6 +119,8 @@ foreach eo_file : pub_eo_files
'-gchd', '@INPUT@'])
endforeach
pub_eo_files += pub_legacy_eo_files
pub_eo_types_files = [
'efl_gfx_types.eot',
'efl_ui_types.eot',
@ -140,7 +142,15 @@ foreach eo_file : pub_eo_types_files
'-ghd', '@INPUT@'])
endforeach
pub_eo_files = files(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files)
install_data(pub_eo_files + pub_legacy_eo_files + pub_eo_types_files,
install_dir: join_paths(eolian_include_dir, package_version_name)
)
efl_interfaces_eo_files = pub_eo_files
efl_interfaces_eot_files = pub_eo_types_files
pub_eo_files = []
pub_eo_types_files = []
efl_src += files([
'efl_interfaces_main.c',

View File

@ -9,6 +9,7 @@ efl_header_src = [
efl_src = []
subdir('interfaces')
package_header_subdirs += 'interfaces'
efl_lib = library('efl',
efl_src, pub_eo_file_target,
@ -24,10 +25,8 @@ efl = declare_dependency(
sources : pub_eo_file_target
)
install_data(pub_eo_files,
install_dir: join_paths(eolian_include_dir, package_version_name)
)
install_headers(efl_header_src,
install_dir : dir_package_include,
)
package_eo_subdirs += ['interfaces']

View File

@ -79,6 +79,8 @@ pub_eo_files = [
'efl_canvas_text.eo'
]
evas_canvas_eo_files = pub_eo_files
pub_evas_eo_files += files(pub_eo_files)
foreach eo_file : pub_eo_files
@ -111,6 +113,8 @@ pub_eo_types_files = [
'efl_canvas_animation_types.eot'
]
evas_canvas_eot_files = pub_eo_types_files
foreach eo_file : pub_eo_types_files
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
input : eo_file,
@ -217,3 +221,5 @@ evas_include_directories += include_directories('.')
install_headers('evas_textblock_legacy.h',
install_dir : join_paths(dir_package_include, 'canvas'),
)
pub_eo_types_files = []

View File

@ -7,6 +7,8 @@ pub_eo_files = [
'efl_canvas_gesture_manager.eo'
]
evas_gesture_eo_files = pub_eo_files
foreach eo_file : pub_eo_files
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
input : eo_file,
@ -65,9 +67,11 @@ endforeach
pub_eo_types_files = [
'efl_canvas_gesture_types.eot',
]
evas_gesture_eot_files = pub_eo_types_files
pub_evas_eot_files += files(pub_eo_types_files)
foreach eo_file : pub_eo_types_files
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
input : eo_file,
@ -91,3 +95,5 @@ evas_src += files([
'efl_canvas_gesture_recognizer_long_tap.c',
'efl_canvas_gesture_manager.c',
])
pub_eo_types_files = []

View File

@ -187,3 +187,6 @@ install_headers(evas_header_src,
)
automatic_pkgfile = false
pub_eo_files = []
package_eo_subdirs += ['canvas', 'gesture']
package_header_subdirs += ['canvas', 'gesture']

View File

@ -7,9 +7,11 @@ evas_lib = library('evas',
version : meson.project_version()
)
evas_pub_deps = [eina, ecore, ector, emile, evas_pre]
evas = declare_dependency(
link_with : [evas_lib],
dependencies : [eina, ecore, ector, emile, evas_pre],
dependencies : evas_pub_deps,
include_directories : evas_include_directories
)
@ -19,11 +21,16 @@ evas_bin = declare_dependency(
include_directories : evas_include_directories
)
tmp_package_subdirs = []
automatic_pkgfile = false
foreach subdir : evas_header_subdirs
tmp_package_subdirs += join_paths('evas-'+version_major, subdir)
endforeach
pkgconfig.generate(evas_lib,
name : 'evas',
subdirs : 'evas-'+version_major,
subdirs : ['evas-'+version_major] + tmp_package_subdirs,
version : version_major + '.' + version_minor,
libraries : [eina, ecore, ector, emile, dependency('luajit')],
)