summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-10-17 13:04:07 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-10-24 12:05:58 +0200
commit6f9761ff54cf1c6e3d90407beefeee50118d6a9c (patch)
treef991b0659b22a68cf7e5ee3fd3010e631a359fae
parente85311c99286988f98ce081148f6f9e298086c2d (diff)
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
-rw-r--r--meson.build4
-rw-r--r--meson_options.txt6
-rw-r--r--src/bindings/mono/ecore_evas_mono/meson.build1
-rwxr-xr-xsrc/bindings/mono/efl_mono/map_generate.sh3
-rw-r--r--src/bindings/mono/efl_mono/meson.build35
-rw-r--r--src/bindings/mono/eina_mono/meson.build20
-rw-r--r--src/bindings/mono/eldbus_mono/meson.build10
-rw-r--r--src/bindings/mono/eo_mono/meson.build4
-rw-r--r--src/bindings/mono/eolian_mono/meson.build9
-rw-r--r--src/bindings/mono/meson.build130
-rw-r--r--src/tests/efl_mono/meson.build69
11 files changed, 289 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 83e9dc8117..b69113efa3 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
1project('efl', ['c','cpp'], 1project('efl', ['c','cpp', 'cs'],
2 version: '1.21.99', 2 version: '1.21.99',
3 default_options : ['buildtype=plain'], 3 default_options : ['buildtype=plain'],
4 meson_version : '>=0.46' 4 meson_version : '>=0.46'
@@ -313,7 +313,7 @@ subdir(join_paths('src', 'bin', 'efl'))
313subdir(join_paths('src', 'generic', 'evas')) 313subdir(join_paths('src', 'generic', 'evas'))
314subdir(join_paths('src', 'generic', 'emotion')) 314subdir(join_paths('src', 'generic', 'emotion'))
315 315
316bindings = ['luajit', 'cxx'] 316bindings = ['luajit', 'cxx', 'mono']
317 317
318foreach binding : bindings 318foreach binding : bindings
319 if get_option(binding) 319 if get_option(binding)
diff --git a/meson_options.txt b/meson_options.txt
index 5ad5d6c8a6..0c70277826 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -321,3 +321,9 @@ option('cxx',
321 value: true, 321 value: true,
322 description: 'Flag for handling cxx bindings' 322 description: 'Flag for handling cxx bindings'
323) 323)
324
325option('mono',
326 type: 'boolean',
327 value: true,
328 description: 'Flag for handling c# bindings'
329)
diff --git a/src/bindings/mono/ecore_evas_mono/meson.build b/src/bindings/mono/ecore_evas_mono/meson.build
new file mode 100644
index 0000000000..6020a63a75
--- /dev/null
+++ b/src/bindings/mono/ecore_evas_mono/meson.build
@@ -0,0 +1 @@
mono_files += files('ecore_evas.cs')
diff --git a/src/bindings/mono/efl_mono/map_generate.sh b/src/bindings/mono/efl_mono/map_generate.sh
new file mode 100755
index 0000000000..263e2f2fa9
--- /dev/null
+++ b/src/bindings/mono/efl_mono/map_generate.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3find ${MESON_SOURCE_ROOT}/src/lib/ -iname "*\.eo" | sed -n 's/.*\/src\/lib\/\([a-z0-9_]*\)[\/a-z]*\/\([a-z0-9\._]*\)/\2,\1/pg'
diff --git a/src/bindings/mono/efl_mono/meson.build b/src/bindings/mono/efl_mono/meson.build
new file mode 100644
index 0000000000..9134de5bbd
--- /dev/null
+++ b/src/bindings/mono/efl_mono/meson.build
@@ -0,0 +1,35 @@
1mono_files += files('efl_all.cs')
2
3bash = find_program('bash')
4
5map = run_command('map_generate.sh').stdout()
6
7
8efl_mono_lib = library('eflcustomexportsmono',
9 join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
10 install : true,
11 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
12 dependencies : [eo, eina]
13)
14
15efl_libs = configuration_data()
16efl_libs.set('EFL_MONO_LIBRARY_MAP', map)
17efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
18efl_libs.set('EVIL_DL_MONO', 'dl')
19
20foreach mono_libs : mono_sublibs
21 key = mono_libs[0].to_upper()+'_DL_MONO'
22 efl_libs.set(key, mono_libs[0].to_lower())
23endforeach
24
25configure_file(
26 input: 'efl_libs.csv.in',
27 output: 'efl_libs.csv',
28 configuration: efl_libs
29)
30
31efl_src = configure_file(
32 input: 'efl_libs.cs.in',
33 output: 'efl_libs.cs',
34 configuration: efl_libs
35)
diff --git a/src/bindings/mono/eina_mono/meson.build b/src/bindings/mono/eina_mono/meson.build
new file mode 100644
index 0000000000..1d9e4e6a43
--- /dev/null
+++ b/src/bindings/mono/eina_mono/meson.build
@@ -0,0 +1,20 @@
1mono_files += files(
2 'eina_config.cs',
3 'eina_array.cs',
4 'eina_hash.cs',
5 'eina_list.cs',
6 'eina_inarray.cs',
7 'eina_inlist.cs',
8 'eina_iterator.cs',
9 'eina_container_common.cs',
10 'eina_common.cs',
11 'eina_log.cs',
12 'eina_binbuf.cs',
13 'eina_slice.cs',
14 'eina_stringshare.cs',
15 'eina_error.cs',
16 'eina_value.cs',
17 'eina_promises.cs',
18 'eina_accessor.cs',
19 'eina_strbuf.cs'
20)
diff --git a/src/bindings/mono/eldbus_mono/meson.build b/src/bindings/mono/eldbus_mono/meson.build
new file mode 100644
index 0000000000..00371eb826
--- /dev/null
+++ b/src/bindings/mono/eldbus_mono/meson.build
@@ -0,0 +1,10 @@
1mono_files += files(
2 'eldbus_common.cs',
3 'eldbus_config.cs',
4 'eldbus_connection.cs',
5 'eldbus_message.cs',
6 'eldbus_object.cs',
7 'eldbus_pending.cs',
8 'eldbus_proxy.cs',
9 'eldbus_service.cs'
10)
diff --git a/src/bindings/mono/eo_mono/meson.build b/src/bindings/mono/eo_mono/meson.build
new file mode 100644
index 0000000000..4fbdf51360
--- /dev/null
+++ b/src/bindings/mono/eo_mono/meson.build
@@ -0,0 +1,4 @@
1mono_files += files(
2 'iwrapper.cs',
3 'workaround.cs'
4)
diff --git a/src/bindings/mono/eolian_mono/meson.build b/src/bindings/mono/eolian_mono/meson.build
new file mode 100644
index 0000000000..7782c7b31d
--- /dev/null
+++ b/src/bindings/mono/eolian_mono/meson.build
@@ -0,0 +1,9 @@
1inc_dir = include_directories(join_paths('..', '..', '..', 'bin', 'eolian_mono'))
2
3eolian_mono_gen = executable('eolian_mono',
4 join_paths('..', '..', '..', 'bin', 'eolian_mono', 'eolian_mono.cc'),
5 dependencies: [eina_cxx, eolian_cxx],
6 install: true,
7 include_directories : inc_dir,
8 cpp_args : package_c_args,
9 )
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
new file mode 100644
index 0000000000..dc948a652e
--- /dev/null
+++ b/src/bindings/mono/meson.build
@@ -0,0 +1,130 @@
1mono_sublibs = [
2 ['Eina', true, ], #
3 ['Eolian', true, ], #
4 ['Eo', true, ], #
5 ['Ecore', false, ], #
6 ['Efl', true, ], #
7 ['Evas', false, ], #
8 ['Edje', false, ], #
9 ['Eldbus', true, ], #
10 ['Ecore_Evas', true, ], #
11 ['Elementary', false, ] #
12]
13
14blacklisted_files = [
15 'efl_canvas_text.eo',
16 'efl_canvas_scene3d.eo',
17 'evas_canvas3d_camera.eo',
18 'evas_canvas3d_light.eo',
19 'evas_canvas3d_material.eo',
20 'evas_canvas3d_mesh.eo',
21 'evas_canvas3d_node.eo',
22 'evas_canvas3d_object.eo',
23 'evas_canvas3d_primitive.eo',
24 'evas_canvas3d_scene.eo',
25 'evas_canvas3d_texture.eo',
26 'efl_canvas_vg_object.eo',
27 'efl_vg.eo',
28 'efl_vg_container.eo',
29 'efl_vg_gradient.eo',
30 'efl_vg_gradient_radial.eo',
31 'efl_vg_gradient_linear.eo',
32 'efl_vg_root_node.eo',
33 'efl_vg_shape.eo.cs',
34 'efl_io_buffer.eo',
35 'efl_io_positioner.eo',
36 'efl_io_queue.eo',
37 'efl_io_sizer.eo',
38 'efl_io_closer_fd.eo',
39 'efl_io_buffered_stream.eo',
40 'efl_io_positioner_fd.eo',
41 'efl_io_reader_fd.eo',
42 'efl_io_writer_fd.eo',
43 'efl_io_copier_fd.eo',
44 'efl_io_sizer_fd.eo',
45 'efl_io_stdin.eo',
46 'efl_io_stdout.eo',
47 'efl_io_stderr.eo',
48 'efl_io_file.eo',
49 'efl_io_copier.eo',
50 'efl_object_override.eo',
51 'elm_web.eo',
52 'elm_map.eo',
53 'elm_combobox.eo',
54 'elm_list.eo',
55 'elm_genlist.eo',
56 'elm_view_list.eo',
57 'elm_genlist_item.eo',
58 'elm_gengrid.eo',
59 'elm_glview.eo.cs'
60]
61
62efl_mono_lib = library('eflcustomexportsmono',
63 join_paths('..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
64 install : true,
65 dependencies : [eo, eina]
66)
67
68mono_generator_target = []
69mono_files = []
70foreach lib : mono_sublibs
71 package_name = lib[0].to_lower()
72 eo_file_subdirs = get_variable(package_name + '_eo_subdirs')
73 file_location = join_paths('..', '..', 'lib', package_name)
74
75 if (package_name != 'eldbus')
76 foreach eo_file_subdir : eo_file_subdirs
77 if eo_file_subdir != ''
78 mono_pub_eo_files = get_variable(package_name + '_' + eo_file_subdir +'_eo_files') + get_variable(package_name + '_' + eo_file_subdir + '_eot_files')
79 else
80 mono_pub_eo_files = get_variable(package_name +'_eo_files') + get_variable(package_name + '_eot_files')
81 endif
82
83 subdir_file_location = join_paths(file_location, eo_file_subdir)
84 foreach mono_gen_file : mono_pub_eo_files
85 if not blacklisted_files.contains(mono_gen_file)
86 mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
87 input : join_paths(subdir_file_location, mono_gen_file),
88 output : [mono_gen_file + '.cs'],
89 command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
90 '--dllimport', package_name,
91 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
92 '@INPUT@'])
93 endif
94 endforeach
95 endforeach
96 endif
97 if lib[1]
98 subdir(package_name + '_mono')
99 endif
100endforeach
101
102legacy_evas_required_by_mono = ['evas_box.eo', 'evas_image.eo', 'evas_table.eo', 'evas_text.eo']
103subdir_file_location = join_paths('..', '..', 'lib', 'evas', 'canvas')
104foreach mono_gen_file : legacy_evas_required_by_mono
105 mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
106 input : join_paths(subdir_file_location, mono_gen_file),
107 output : [mono_gen_file + '.cs'],
108 command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
109 '--dllimport', 'evas',
110 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
111 '@INPUT@'])
112endforeach
113
114efl_mono = library('efl_mono',
115 mono_generator_target + mono_files + [efl_src],
116 install : true,
117 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major)
118)
119
120efl_mono_test_suite_path=join_paths(meson.current_build_dir())
121
122pkgconfig.generate(
123 name : 'efl-mono',
124 description : 'Efl C# bindings',
125 version : version_major + '.' + version_minor,
126 libraries : ['-r:${assemblies_dir}/efl_mono.dll'],
127 variables : ['assemblies_dir='+join_paths(dir_lib, 'efl-mono-'+version_major),
128 'mono_libs=-r:${assemblies_dir}/efl_mono.dll']
129)
130test_dirs += 'efl_mono'
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
new file mode 100644
index 0000000000..9567bd05ca
--- /dev/null
+++ b/src/tests/efl_mono/meson.build
@@ -0,0 +1,69 @@
1eo_files = ['test_child.eo', 'test_numberwrapper.eo', 'test_testing.eo']
2
3eo_file_targets = []
4
5foreach eo_file : eo_files
6 eo_file_targets += custom_target('eolian_gen_' + eo_file,
7 input : eo_file,
8 output : [eo_file + '.h'],
9 command : [eolian_gen, '-I', meson.current_source_dir(), eolian_include_directories,
10 '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
11 '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
12 '-gch', '@INPUT@'])
13endforeach
14
15
16
17efl_mono_native_test = library('efl_mono_native_test',
18 eo_file_targets + ['libefl_mono_native_test.c'],
19 dependencies : [ecore, eo, efl],
20)
21
22eo_file_targets = []
23
24foreach mono_gen_file : eo_files
25 eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
26 input : mono_gen_file,
27 output : [mono_gen_file + '.cs'],
28 command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
29 '--dllimport', 'efl_mono_native_test',
30 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
31 '@INPUT@'])
32endforeach
33
34efl_mono_test = library('efl_mono_test',
35 eo_file_targets,
36 link_with : [efl_mono],
37)
38
39efl_mono_src = [
40 'Main.cs',
41 'TestUtils.cs',
42 'BasicDirection.cs',
43 'Eina.cs',
44 'Eldbus.cs',
45 'Eo.cs',
46 'EoPromises.cs',
47 'Errors.cs',
48 'Evas.cs',
49 'Events.cs',
50 'FunctionPointers.cs',
51 'FunctionPointerMarshalling.cs',
52 'Parts.cs',
53 'Promises.cs',
54 'Strbuf.cs',
55 'Strings.cs',
56 'Structs.cs',
57 'Value.cs',
58 'ValueEolian.cs'
59]
60
61efl_mono_suite = executable('efl-mono-suite',
62 efl_mono_src,
63 link_with : [efl_mono, efl_mono_test],
64)
65
66test('efl-mono-suite',
67 efl_mono_suite,
68 env : ['MONO_PATH='+efl_mono_test_suite_path]
69)