forked from enlightenment/efl
meson: time for the c-sharp build
The tests are added and build. For running C# code please see the wiki. you can enable -Dmono=true Differential Revision: https://phab.enlightenment.org/D7203
This commit is contained in:
parent
e85311c992
commit
6f9761ff54
|
@ -1,4 +1,4 @@
|
|||
project('efl', ['c','cpp'],
|
||||
project('efl', ['c','cpp', 'cs'],
|
||||
version: '1.21.99',
|
||||
default_options : ['buildtype=plain'],
|
||||
meson_version : '>=0.46'
|
||||
|
@ -313,7 +313,7 @@ subdir(join_paths('src', 'bin', 'efl'))
|
|||
subdir(join_paths('src', 'generic', 'evas'))
|
||||
subdir(join_paths('src', 'generic', 'emotion'))
|
||||
|
||||
bindings = ['luajit', 'cxx']
|
||||
bindings = ['luajit', 'cxx', 'mono']
|
||||
|
||||
foreach binding : bindings
|
||||
if get_option(binding)
|
||||
|
|
|
@ -321,3 +321,9 @@ option('cxx',
|
|||
value: true,
|
||||
description: 'Flag for handling cxx bindings'
|
||||
)
|
||||
|
||||
option('mono',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Flag for handling c# bindings'
|
||||
)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
mono_files += files('ecore_evas.cs')
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
find ${MESON_SOURCE_ROOT}/src/lib/ -iname "*\.eo" | sed -n 's/.*\/src\/lib\/\([a-z0-9_]*\)[\/a-z]*\/\([a-z0-9\._]*\)/\2,\1/pg'
|
|
@ -0,0 +1,35 @@
|
|||
mono_files += files('efl_all.cs')
|
||||
|
||||
bash = find_program('bash')
|
||||
|
||||
map = run_command('map_generate.sh').stdout()
|
||||
|
||||
|
||||
efl_mono_lib = library('eflcustomexportsmono',
|
||||
join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
|
||||
install : true,
|
||||
install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
|
||||
dependencies : [eo, eina]
|
||||
)
|
||||
|
||||
efl_libs = configuration_data()
|
||||
efl_libs.set('EFL_MONO_LIBRARY_MAP', map)
|
||||
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
|
||||
efl_libs.set('EVIL_DL_MONO', 'dl')
|
||||
|
||||
foreach mono_libs : mono_sublibs
|
||||
key = mono_libs[0].to_upper()+'_DL_MONO'
|
||||
efl_libs.set(key, mono_libs[0].to_lower())
|
||||
endforeach
|
||||
|
||||
configure_file(
|
||||
input: 'efl_libs.csv.in',
|
||||
output: 'efl_libs.csv',
|
||||
configuration: efl_libs
|
||||
)
|
||||
|
||||
efl_src = configure_file(
|
||||
input: 'efl_libs.cs.in',
|
||||
output: 'efl_libs.cs',
|
||||
configuration: efl_libs
|
||||
)
|
|
@ -0,0 +1,20 @@
|
|||
mono_files += files(
|
||||
'eina_config.cs',
|
||||
'eina_array.cs',
|
||||
'eina_hash.cs',
|
||||
'eina_list.cs',
|
||||
'eina_inarray.cs',
|
||||
'eina_inlist.cs',
|
||||
'eina_iterator.cs',
|
||||
'eina_container_common.cs',
|
||||
'eina_common.cs',
|
||||
'eina_log.cs',
|
||||
'eina_binbuf.cs',
|
||||
'eina_slice.cs',
|
||||
'eina_stringshare.cs',
|
||||
'eina_error.cs',
|
||||
'eina_value.cs',
|
||||
'eina_promises.cs',
|
||||
'eina_accessor.cs',
|
||||
'eina_strbuf.cs'
|
||||
)
|
|
@ -0,0 +1,10 @@
|
|||
mono_files += files(
|
||||
'eldbus_common.cs',
|
||||
'eldbus_config.cs',
|
||||
'eldbus_connection.cs',
|
||||
'eldbus_message.cs',
|
||||
'eldbus_object.cs',
|
||||
'eldbus_pending.cs',
|
||||
'eldbus_proxy.cs',
|
||||
'eldbus_service.cs'
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
mono_files += files(
|
||||
'iwrapper.cs',
|
||||
'workaround.cs'
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
inc_dir = include_directories(join_paths('..', '..', '..', 'bin', 'eolian_mono'))
|
||||
|
||||
eolian_mono_gen = executable('eolian_mono',
|
||||
join_paths('..', '..', '..', 'bin', 'eolian_mono', 'eolian_mono.cc'),
|
||||
dependencies: [eina_cxx, eolian_cxx],
|
||||
install: true,
|
||||
include_directories : inc_dir,
|
||||
cpp_args : package_c_args,
|
||||
)
|
|
@ -0,0 +1,130 @@
|
|||
mono_sublibs = [
|
||||
['Eina', true, ], #
|
||||
['Eolian', true, ], #
|
||||
['Eo', true, ], #
|
||||
['Ecore', false, ], #
|
||||
['Efl', true, ], #
|
||||
['Evas', false, ], #
|
||||
['Edje', false, ], #
|
||||
['Eldbus', true, ], #
|
||||
['Ecore_Evas', true, ], #
|
||||
['Elementary', false, ] #
|
||||
]
|
||||
|
||||
blacklisted_files = [
|
||||
'efl_canvas_text.eo',
|
||||
'efl_canvas_scene3d.eo',
|
||||
'evas_canvas3d_camera.eo',
|
||||
'evas_canvas3d_light.eo',
|
||||
'evas_canvas3d_material.eo',
|
||||
'evas_canvas3d_mesh.eo',
|
||||
'evas_canvas3d_node.eo',
|
||||
'evas_canvas3d_object.eo',
|
||||
'evas_canvas3d_primitive.eo',
|
||||
'evas_canvas3d_scene.eo',
|
||||
'evas_canvas3d_texture.eo',
|
||||
'efl_canvas_vg_object.eo',
|
||||
'efl_vg.eo',
|
||||
'efl_vg_container.eo',
|
||||
'efl_vg_gradient.eo',
|
||||
'efl_vg_gradient_radial.eo',
|
||||
'efl_vg_gradient_linear.eo',
|
||||
'efl_vg_root_node.eo',
|
||||
'efl_vg_shape.eo.cs',
|
||||
'efl_io_buffer.eo',
|
||||
'efl_io_positioner.eo',
|
||||
'efl_io_queue.eo',
|
||||
'efl_io_sizer.eo',
|
||||
'efl_io_closer_fd.eo',
|
||||
'efl_io_buffered_stream.eo',
|
||||
'efl_io_positioner_fd.eo',
|
||||
'efl_io_reader_fd.eo',
|
||||
'efl_io_writer_fd.eo',
|
||||
'efl_io_copier_fd.eo',
|
||||
'efl_io_sizer_fd.eo',
|
||||
'efl_io_stdin.eo',
|
||||
'efl_io_stdout.eo',
|
||||
'efl_io_stderr.eo',
|
||||
'efl_io_file.eo',
|
||||
'efl_io_copier.eo',
|
||||
'efl_object_override.eo',
|
||||
'elm_web.eo',
|
||||
'elm_map.eo',
|
||||
'elm_combobox.eo',
|
||||
'elm_list.eo',
|
||||
'elm_genlist.eo',
|
||||
'elm_view_list.eo',
|
||||
'elm_genlist_item.eo',
|
||||
'elm_gengrid.eo',
|
||||
'elm_glview.eo.cs'
|
||||
]
|
||||
|
||||
efl_mono_lib = library('eflcustomexportsmono',
|
||||
join_paths('..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
|
||||
install : true,
|
||||
dependencies : [eo, eina]
|
||||
)
|
||||
|
||||
mono_generator_target = []
|
||||
mono_files = []
|
||||
foreach lib : mono_sublibs
|
||||
package_name = lib[0].to_lower()
|
||||
eo_file_subdirs = get_variable(package_name + '_eo_subdirs')
|
||||
file_location = join_paths('..', '..', 'lib', package_name)
|
||||
|
||||
if (package_name != 'eldbus')
|
||||
foreach eo_file_subdir : eo_file_subdirs
|
||||
if eo_file_subdir != ''
|
||||
mono_pub_eo_files = get_variable(package_name + '_' + eo_file_subdir +'_eo_files') + get_variable(package_name + '_' + eo_file_subdir + '_eot_files')
|
||||
else
|
||||
mono_pub_eo_files = get_variable(package_name +'_eo_files') + get_variable(package_name + '_eot_files')
|
||||
endif
|
||||
|
||||
subdir_file_location = join_paths(file_location, eo_file_subdir)
|
||||
foreach mono_gen_file : mono_pub_eo_files
|
||||
if not blacklisted_files.contains(mono_gen_file)
|
||||
mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
||||
input : join_paths(subdir_file_location, mono_gen_file),
|
||||
output : [mono_gen_file + '.cs'],
|
||||
command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'--dllimport', package_name,
|
||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||
'@INPUT@'])
|
||||
endif
|
||||
endforeach
|
||||
endforeach
|
||||
endif
|
||||
if lib[1]
|
||||
subdir(package_name + '_mono')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
legacy_evas_required_by_mono = ['evas_box.eo', 'evas_image.eo', 'evas_table.eo', 'evas_text.eo']
|
||||
subdir_file_location = join_paths('..', '..', 'lib', 'evas', 'canvas')
|
||||
foreach mono_gen_file : legacy_evas_required_by_mono
|
||||
mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
||||
input : join_paths(subdir_file_location, mono_gen_file),
|
||||
output : [mono_gen_file + '.cs'],
|
||||
command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'--dllimport', 'evas',
|
||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||
'@INPUT@'])
|
||||
endforeach
|
||||
|
||||
efl_mono = library('efl_mono',
|
||||
mono_generator_target + mono_files + [efl_src],
|
||||
install : true,
|
||||
install_dir : join_paths(dir_lib, 'efl-mono-'+version_major)
|
||||
)
|
||||
|
||||
efl_mono_test_suite_path=join_paths(meson.current_build_dir())
|
||||
|
||||
pkgconfig.generate(
|
||||
name : 'efl-mono',
|
||||
description : 'Efl C# bindings',
|
||||
version : version_major + '.' + version_minor,
|
||||
libraries : ['-r:${assemblies_dir}/efl_mono.dll'],
|
||||
variables : ['assemblies_dir='+join_paths(dir_lib, 'efl-mono-'+version_major),
|
||||
'mono_libs=-r:${assemblies_dir}/efl_mono.dll']
|
||||
)
|
||||
test_dirs += 'efl_mono'
|
|
@ -0,0 +1,69 @@
|
|||
eo_files = ['test_child.eo', 'test_numberwrapper.eo', 'test_testing.eo']
|
||||
|
||||
eo_file_targets = []
|
||||
|
||||
foreach eo_file : eo_files
|
||||
eo_file_targets += custom_target('eolian_gen_' + eo_file,
|
||||
input : eo_file,
|
||||
output : [eo_file + '.h'],
|
||||
command : [eolian_gen, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
|
||||
'-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
|
||||
'-gch', '@INPUT@'])
|
||||
endforeach
|
||||
|
||||
|
||||
|
||||
efl_mono_native_test = library('efl_mono_native_test',
|
||||
eo_file_targets + ['libefl_mono_native_test.c'],
|
||||
dependencies : [ecore, eo, efl],
|
||||
)
|
||||
|
||||
eo_file_targets = []
|
||||
|
||||
foreach mono_gen_file : eo_files
|
||||
eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
||||
input : mono_gen_file,
|
||||
output : [mono_gen_file + '.cs'],
|
||||
command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
|
||||
'--dllimport', 'efl_mono_native_test',
|
||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||
'@INPUT@'])
|
||||
endforeach
|
||||
|
||||
efl_mono_test = library('efl_mono_test',
|
||||
eo_file_targets,
|
||||
link_with : [efl_mono],
|
||||
)
|
||||
|
||||
efl_mono_src = [
|
||||
'Main.cs',
|
||||
'TestUtils.cs',
|
||||
'BasicDirection.cs',
|
||||
'Eina.cs',
|
||||
'Eldbus.cs',
|
||||
'Eo.cs',
|
||||
'EoPromises.cs',
|
||||
'Errors.cs',
|
||||
'Evas.cs',
|
||||
'Events.cs',
|
||||
'FunctionPointers.cs',
|
||||
'FunctionPointerMarshalling.cs',
|
||||
'Parts.cs',
|
||||
'Promises.cs',
|
||||
'Strbuf.cs',
|
||||
'Strings.cs',
|
||||
'Structs.cs',
|
||||
'Value.cs',
|
||||
'ValueEolian.cs'
|
||||
]
|
||||
|
||||
efl_mono_suite = executable('efl-mono-suite',
|
||||
efl_mono_src,
|
||||
link_with : [efl_mono, efl_mono_test],
|
||||
)
|
||||
|
||||
test('efl-mono-suite',
|
||||
efl_mono_suite,
|
||||
env : ['MONO_PATH='+efl_mono_test_suite_path]
|
||||
)
|
Loading…
Reference in New Issue