summaryrefslogtreecommitdiff
path: root/src/bindings/mono
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 /src/bindings/mono
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
Diffstat (limited to 'src/bindings/mono')
-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
8 files changed, 212 insertions, 0 deletions
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'