summaryrefslogtreecommitdiff
path: root/src/bindings/mono/meson.build
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-16 16:29:56 +0900
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-03-01 23:58:56 -0300
commitf392c5a4363cf09e8c0e50a42c46416a09a72c74 (patch)
tree1966addc0a769679e9dfa641df816c80d243651b /src/bindings/mono/meson.build
parentdd89eb2fd1755c2816d97f28822639e03ed38608 (diff)
efl-mono: Add support for dotnet core
Summary: This commits adds dotnet as a supported C# platform for EFL# bindings. Due to differences between Mono and Dotnet regarding DllImport, the bindings now are using an imperative approach to load the function pointers through the NativeModule and FunctionWrapper classes. These classes handle the dlopen/LoadLibrary and dlsym/GetProcAddress calls. Also, the previous caching of non-owned strings returned to native code was removed until further memory checks. We also had to create workaround for bool and chars in Structs for C# marshaling. Going through System.Byte instead and Marshaling manually to their respective types. In order to actually build efl_mono.dll with dotnet right now, issue #4782 from Meson should be fixed to make it properly detect and used the Dotnet compiler. Also use "-Ddotnet=true" when running meson. Fixes T7394 Reviewers: felipealmeida, vitor.sousa, bu5hm4n Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl Maniphest Tasks: T7394 Differential Revision: https://phab.enlightenment.org/D8069
Diffstat (limited to 'src/bindings/mono/meson.build')
-rw-r--r--src/bindings/mono/meson.build43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
index ed6f91b..d14d5ad 100644
--- a/src/bindings/mono/meson.build
+++ b/src/bindings/mono/meson.build
@@ -1,5 +1,31 @@
1add_languages('cs') 1add_languages('cs')
2 2
3
4runtime_assemblies = []
5
6# Check if we should use dotnet options
7cs_is_dotnet = meson.get_compiler('cs').get_id().contains('dotnet')
8
9if (cs_is_dotnet)
10
11runtime_assemblies += [
12 'System.Console',
13 'Microsoft.CSharp',
14 'System.Collections',
15 'System.Collections.Concurrent',
16 'System.ComponentModel.Primitives',
17 'System.ComponentModel.Primitives',
18 'System.Diagnostics.Debug',
19 'System.Diagnostics.TraceSource',
20 'System.Dynamic.Runtime',
21 'System.Linq',
22 'System.Runtime',
23 'System.Runtime.Extensions',
24 'System.Security',
25]
26
27endif
28
3mono_sublibs = [ 29mono_sublibs = [
4 ['Eina', true, ], # 30 ['Eina', true, ], #
5 ['Eolian', true, ], # 31 ['Eolian', true, ], #
@@ -114,15 +140,24 @@ efl_mono_conf_data.set('EVAS', evas_lib.full_path())
114efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path()) 140efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path())
115efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path()) 141efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path())
116 142
117configure_file(input : 'efl_mono.dll.config.in', 143efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in',
118 output : 'efl_mono.dll.config', 144 output : 'efl_mono.dll.config',
119 configuration : efl_mono_conf_data) 145 configuration : efl_mono_conf_data)
120 146
147if (cs_is_dotnet)
148efl_mono = library('efl_mono',
149 mono_generator_target + mono_files + [efl_src],
150 install : true,
151 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
152 runtime_assemblies : runtime_assemblies
153)
154else
121efl_mono = library('efl_mono', 155efl_mono = library('efl_mono',
122 mono_generator_target + mono_files + [efl_src], 156 mono_generator_target + mono_files + [efl_src],
123 install : true, 157 install : true,
124 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major) 158 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
125) 159)
160endif
126 161
127efl_mono_test_suite_path=join_paths(meson.current_build_dir()) 162efl_mono_test_suite_path=join_paths(meson.current_build_dir())
128 163