lauromoura pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e6fafe4e614e1ebb72e44f006f8adba9edccedaf

commit e6fafe4e614e1ebb72e44f006f8adba9edccedaf
Author: Yeongjong Lee <[email protected]>
Date:   Mon Oct 28 17:10:48 2019 -0300

    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
---
 meson_options.txt                             |  6 ++++++
 src/bindings/mono/efl_mono/AssemblyInfo.cs.in |  3 +++
 src/bindings/mono/efl_mono/meson.build        | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/meson_options.txt b/meson_options.txt
index 0a4702cad8..66ef0257f4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -366,3 +366,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'

-- 


Reply via email to