summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-10-28 17:10:48 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-31 12:06:26 -0300
commit460daee7a8e9f0e0f5c3cdfe404282f01de47d1c (patch)
tree29721faea127f42e2fddbfa4186be501771ea943
parent36c14a2a0599d27c56c23bd6667e952e8738ca3f (diff)
downloadefl-460daee7a8e9f0e0f5c3cdfe404282f01de47d1c.tar.gz
mono: introduce friend assembly
Summary: Friend assemblies can access efl_mono assembly's internal types and members. If `build-tests` option is true, `efl-mono-suite.exe` and `efl_mono_test.dll` will become friend assemblies. Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura, segfaultxavi, Jaehyun_Cho Reviewed By: lauromoura Subscribers: felipealmeida, cedric, #reviewers, woohyun, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10337
-rw-r--r--meson_options.txt6
-rw-r--r--src/bindings/mono/efl_mono/AssemblyInfo.cs.in3
-rw-r--r--src/bindings/mono/efl_mono/meson.build19
3 files changed, 28 insertions, 0 deletions
diff --git a/meson_options.txt b/meson_options.txt
index 33e74dedbb..aaa8c89fd4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -373,3 +373,9 @@ option('install-eo-files',
value: false,
description : 'Install any eo file'
)
+
+option('mono-friend-assemblies',
+ type : 'array',
+ value : [],
+ description : 'List of friend assemblies that can access efl_mono assembly\'s internal types and members.'
+)
diff --git a/src/bindings/mono/efl_mono/AssemblyInfo.cs.in b/src/bindings/mono/efl_mono/AssemblyInfo.cs.in
new file mode 100644
index 0000000000..e22d0a4140
--- /dev/null
+++ b/src/bindings/mono/efl_mono/AssemblyInfo.cs.in
@@ -0,0 +1,3 @@
+using System.Runtime.CompilerServices;
+
+@MONO_FRIEND_ASSEMBLIES@
diff --git a/src/bindings/mono/efl_mono/meson.build b/src/bindings/mono/efl_mono/meson.build
index cfe53ee153..6542f5124a 100644
--- a/src/bindings/mono/efl_mono/meson.build
+++ b/src/bindings/mono/efl_mono/meson.build
@@ -34,6 +34,25 @@ efl_src = configure_file(
configuration: efl_libs
)
+friend_assemblies = ''
+mono_friend_assemblies = get_option('mono-friend-assemblies')
+if get_option('build-tests')
+ mono_friend_assemblies += 'efl-mono-suite'
+ mono_friend_assemblies += 'efl_mono_test'
+endif
+
+foreach f : mono_friend_assemblies
+ friend_assemblies += '[assembly: InternalsVisibleTo("@0@")]\n'.format(f)
+endforeach
+friend_assembly_data = configuration_data()
+friend_assembly_data.set('MONO_FRIEND_ASSEMBLIES', friend_assemblies)
+
+mono_files += configure_file(
+ input: 'AssemblyInfo.cs.in',
+ output: 'AssemblyInfo.cs',
+ configuration: friend_assembly_data
+)
+
mono_eo_files = [
'efl_mono_model_internal.eo',
'efl_mono_model_internal_child.eo'