diff options
author | Felipe Magno de Almeida <felipe@expertisesolutions.com.br> | 2019-01-16 16:29:56 +0900 |
---|---|---|
committer | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2019-02-20 11:54:21 -0300 |
commit | 9a62dcb7c71e177c704ef1d5d5efadc631fa5f91 (patch) | |
tree | 0fc31804f3693d31e1950e54388fa60b330f881b | |
parent | dc563769900310241962c3e920559a1074ea5d2f (diff) | |
download | efl-9a62dcb7c71e177c704ef1d5d5efadc631fa5f91.tar.gz |
efl-mono: Add support for dotnet core
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | src/bindings/mono/eo_mono/meson.build | 12 | ||||
-rw-r--r-- | src/bindings/mono/meson.build | 17 | ||||
-rw-r--r-- | src/tests/efl_mono/efl-mono-suite.runtimeconfig.json | 10 | ||||
-rw-r--r-- | src/tests/efl_mono/meson.build | 37 |
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', description: 'Flag for enabling @beta Eo methods in the api' ) +option('dotnet', + type: 'boolean', + value: false, + description: 'Flag for enabling compilation with dotnet core' +) + option('native-arch-optimization', type: 'boolean', 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 @@ mono_files += files( 'iwrapper.cs', - 'workaround.cs' + 'workaround.cs', + 'FunctionWrapper.cs', + 'NativeModule.cs' ) + +if host_machine.system() == 'windows' + mono_files += files('FunctionWrapper_Windows.cs', 'NativeModule_Windows.cs') +else + mono_files += files('FunctionWrapper_Unix.cs', 'NativeModule_Unix.cs') +endif + + 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()) efl_mono_conf_data.set('ELDBUS', eldbus_lib.full_path()) efl_mono_conf_data.set('ELEMENTARY', elementary_lib.full_path()) -configure_file(input : 'efl_mono.dll.config.in', - output : 'efl_mono.dll.config', - configuration : efl_mono_conf_data) +efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in', + output : 'efl_mono.dll.config', + configuration : efl_mono_conf_data) +if (get_option('dotnet')) efl_mono = library('efl_mono', mono_generator_target + mono_files + [efl_src], install : true, - install_dir : join_paths(dir_lib, 'efl-mono-'+version_major) + install_dir : join_paths(dir_lib, 'efl-mono-'+version_major), + 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'] ) +else +efl_mono = library('efl_mono', + mono_generator_target + mono_files + [efl_src], + install : true, + install_dir : join_paths(dir_lib, 'efl-mono-'+version_major), +) +endif efl_mono_test_suite_path=join_paths(meson.current_build_dir()) 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 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp2.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "2.0.0" + } + } +} + 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 '@INPUT@']) endforeach +if (get_option('dotnet')) efl_mono_test = library('efl_mono_test', eo_file_targets, link_with : [efl_mono], + 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'] ) +else +efl_mono_test = library('efl_mono_test', + eo_file_targets, + link_with : [efl_mono], +) +endif efl_mono_src = [ 'Main.cs', @@ -61,14 +69,43 @@ efl_mono_src = [ 'Inheritance.cs', ] +if (get_option('dotnet')) efl_mono_suite = executable('efl-mono-suite', efl_mono_src, link_with : [efl_mono, efl_mono_test], + 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'] ) +else +efl_mono_suite = executable('efl-mono-suite', + efl_mono_src, + link_with : [efl_mono, efl_mono_test], +) +endif env = environment() env.set('MONO_PATH', efl_mono_test_suite_path ) +if (get_option('dotnet')) +env.set('LD_LIBRARY_PATH', efl_mono_test_suite_path ) +copy_prog = find_program(['cp', 'copy']) + +configure_file(input : 'efl-mono-suite.runtimeconfig.json', + output : 'efl-mono-suite.runtimeconfig.json', + copy : true) + +custom_target('copy_efl_mono_dll', + build_by_default : true, + input : efl_mono, + output : efl_mono.full_path().split('/')[-1], + command : [copy_prog, '@INPUT@', '@OUTPUT@']) + +custom_target('copy_efl_mono_lib_dll', + build_by_default : true, + input : efl_mono_lib, + output : efl_mono_lib.full_path().split('/')[-1], + command : [copy_prog, '@INPUT@', '@OUTPUT@']) +endif + config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary'] load_lib = '' |