summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-16 16:29:56 +0900
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-02-20 11:54:21 -0300
commit9a62dcb7c71e177c704ef1d5d5efadc631fa5f91 (patch)
tree0fc31804f3693d31e1950e54388fa60b330f881b
parentdc563769900310241962c3e920559a1074ea5d2f (diff)
efl-mono: Add support for dotnet core
-rw-r--r--meson_options.txt6
-rw-r--r--src/bindings/mono/eo_mono/meson.build12
-rw-r--r--src/bindings/mono/meson.build17
-rw-r--r--src/tests/efl_mono/efl-mono-suite.runtimeconfig.json10
-rw-r--r--src/tests/efl_mono/meson.build37
5 files changed, 77 insertions, 5 deletions
diff --git a/meson_options.txt b/meson_options.txt
index c1677606ee..e7d965cc8a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -323,6 +323,12 @@ option('mono-beta',
323 description: 'Flag for enabling @beta Eo methods in the api' 323 description: 'Flag for enabling @beta Eo methods in the api'
324) 324)
325 325
326option('dotnet',
327 type: 'boolean',
328 value: false,
329 description: 'Flag for enabling compilation with dotnet core'
330)
331
326option('native-arch-optimization', 332option('native-arch-optimization',
327 type: 'boolean', 333 type: 'boolean',
328 value: true, 334 value: true,
diff --git a/src/bindings/mono/eo_mono/meson.build b/src/bindings/mono/eo_mono/meson.build
index 4fbdf51360..dfc6000d36 100644
--- a/src/bindings/mono/eo_mono/meson.build
+++ b/src/bindings/mono/eo_mono/meson.build
@@ -1,4 +1,14 @@
1mono_files += files( 1mono_files += files(
2 'iwrapper.cs', 2 'iwrapper.cs',
3 'workaround.cs' 3 'workaround.cs',
4 'FunctionWrapper.cs',
5 'NativeModule.cs'
4) 6)
7
8if host_machine.system() == 'windows'
9 mono_files += files('FunctionWrapper_Windows.cs', 'NativeModule_Windows.cs')
10else
11 mono_files += files('FunctionWrapper_Unix.cs', 'NativeModule_Unix.cs')
12endif
13
14
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
index b9d6879998..baca76b134 100644
--- a/src/bindings/mono/meson.build
+++ b/src/bindings/mono/meson.build
@@ -126,15 +126,24 @@ efl_mono_conf_data.set('EVAS', evas_lib.full_path())
126efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path()) 126efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path())
127efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path()) 127efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path())
128 128
129configure_file(input : 'efl_mono.dll.config.in', 129efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in',
130 output : 'efl_mono.dll.config', 130 output : 'efl_mono.dll.config',
131 configuration : efl_mono_conf_data) 131 configuration : efl_mono_conf_data)
132 132
133if (get_option('dotnet'))
133efl_mono = library('efl_mono', 134efl_mono = library('efl_mono',
134 mono_generator_target + mono_files + [efl_src], 135 mono_generator_target + mono_files + [efl_src],
135 install : true, 136 install : true,
136 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major) 137 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
138 runtime_assemblies : ['System.Private.CoreLib','System.Console','System.Runtime','System.Linq','System.Dynamic.Runtime','System.Security','System.ComponentModel.Primitives','System.Runtime.Extensions','System.Diagnostics.Debug','System.Diagnostics.TraceSource','Microsoft.CSharp','System.Collections']
137) 139)
140else
141efl_mono = library('efl_mono',
142 mono_generator_target + mono_files + [efl_src],
143 install : true,
144 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
145)
146endif
138 147
139efl_mono_test_suite_path=join_paths(meson.current_build_dir()) 148efl_mono_test_suite_path=join_paths(meson.current_build_dir())
140 149
diff --git a/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json
new file mode 100644
index 0000000000..0773dae0a0
--- /dev/null
+++ b/src/tests/efl_mono/efl-mono-suite.runtimeconfig.json
@@ -0,0 +1,10 @@
1{
2 "runtimeOptions": {
3 "tfm": "netcoreapp2.0",
4 "framework": {
5 "name": "Microsoft.NETCore.App",
6 "version": "2.0.0"
7 }
8 }
9}
10
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
index b01e2747af..350f1ee021 100644
--- a/src/tests/efl_mono/meson.build
+++ b/src/tests/efl_mono/meson.build
@@ -31,10 +31,18 @@ foreach mono_gen_file : eo_files
31 '@INPUT@']) 31 '@INPUT@'])
32endforeach 32endforeach
33 33
34if (get_option('dotnet'))
34efl_mono_test = library('efl_mono_test', 35efl_mono_test = library('efl_mono_test',
35 eo_file_targets, 36 eo_file_targets,
36 link_with : [efl_mono], 37 link_with : [efl_mono],
38 runtime_assemblies : ['System.Private.CoreLib','System.Console','System.Runtime','System.Linq','System.Dynamic.Runtime','System.Security','System.ComponentModel.Primitives','System.Runtime.Extensions','System.Diagnostics.Debug','System.Diagnostics.TraceSource','Microsoft.CSharp','System.Collections']
37) 39)
40else
41efl_mono_test = library('efl_mono_test',
42 eo_file_targets,
43 link_with : [efl_mono],
44)
45endif
38 46
39efl_mono_src = [ 47efl_mono_src = [
40 'Main.cs', 48 'Main.cs',
@@ -61,14 +69,43 @@ efl_mono_src = [
61 'Inheritance.cs', 69 'Inheritance.cs',
62] 70]
63 71
72if (get_option('dotnet'))
64efl_mono_suite = executable('efl-mono-suite', 73efl_mono_suite = executable('efl-mono-suite',
65 efl_mono_src, 74 efl_mono_src,
66 link_with : [efl_mono, efl_mono_test], 75 link_with : [efl_mono, efl_mono_test],
76 runtime_assemblies : ['System.Private.CoreLib','System.Console','System.Runtime','System.Linq','System.Dynamic.Runtime','System.Security','System.ComponentModel.Primitives','System.Runtime.Extensions','System.Diagnostics.Debug','System.Diagnostics.TraceSource','Microsoft.CSharp','System.Collections']
67) 77)
78else
79efl_mono_suite = executable('efl-mono-suite',
80 efl_mono_src,
81 link_with : [efl_mono, efl_mono_test],
82)
83endif
68 84
69env = environment() 85env = environment()
70env.set('MONO_PATH', efl_mono_test_suite_path ) 86env.set('MONO_PATH', efl_mono_test_suite_path )
71 87
88if (get_option('dotnet'))
89env.set('LD_LIBRARY_PATH', efl_mono_test_suite_path )
90copy_prog = find_program(['cp', 'copy'])
91
92configure_file(input : 'efl-mono-suite.runtimeconfig.json',
93 output : 'efl-mono-suite.runtimeconfig.json',
94 copy : true)
95
96custom_target('copy_efl_mono_dll',
97 build_by_default : true,
98 input : efl_mono,
99 output : efl_mono.full_path().split('/')[-1],
100 command : [copy_prog, '@INPUT@', '@OUTPUT@'])
101
102custom_target('copy_efl_mono_lib_dll',
103 build_by_default : true,
104 input : efl_mono_lib,
105 output : efl_mono_lib.full_path().split('/')[-1],
106 command : [copy_prog, '@INPUT@', '@OUTPUT@'])
107endif
108
72config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary'] 109config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary']
73load_lib = '' 110load_lib = ''
74 111