csharp: add a interface to start apps
Summary:
until to today you had to call init functions and a run function which
were static function in a class called Efl.Ui.Config.
However, calling those init functions there is not really OOP style.
Right now things have changed into a manner where you are defining you
application class with inheriting from the Application /
SimpleApplication abstract.
This enables you to call launch() on your application class, calling
launch there leads to a call to the args function, you can call and use
the Efl classes in there, everything is booted up.
Option parsing and dependency start can still be done in the main method
or application constructor, just ensure that you never call any efl
class / function outside the launch function.
A commit that demonstrates the usage can be found at
ref T7204
https://git.enlightenment.org/tools/examples.git/log/?h=devs/bu5hm4n/POC
Reviewers: felipealmeida, segfaultxavi, Jaehyun_Cho, cedric
Reviewed By: segfaultxavi
Subscribers: zmike, woohyun, akanad, lauromoura, #reviewers, #committers
Tags: #efl_language_bindings
Maniphest Tasks: T7204
Differential Revision: https://phab.enlightenment.org/D7495
2019-01-16 03:28:36 -08:00
|
|
|
mono_files += files(
|
|
|
|
'efl_all.cs',
|
2019-08-05 07:17:52 -07:00
|
|
|
'efl_csharp_application.cs',
|
|
|
|
'UserModel.cs',
|
|
|
|
'GenericModel.cs',
|
2019-10-16 06:31:22 -07:00
|
|
|
'ItemFactory.cs',
|
2019-08-05 07:17:52 -07:00
|
|
|
'Bind.cs'
|
csharp: add a interface to start apps
Summary:
until to today you had to call init functions and a run function which
were static function in a class called Efl.Ui.Config.
However, calling those init functions there is not really OOP style.
Right now things have changed into a manner where you are defining you
application class with inheriting from the Application /
SimpleApplication abstract.
This enables you to call launch() on your application class, calling
launch there leads to a call to the args function, you can call and use
the Efl classes in there, everything is booted up.
Option parsing and dependency start can still be done in the main method
or application constructor, just ensure that you never call any efl
class / function outside the launch function.
A commit that demonstrates the usage can be found at
ref T7204
https://git.enlightenment.org/tools/examples.git/log/?h=devs/bu5hm4n/POC
Reviewers: felipealmeida, segfaultxavi, Jaehyun_Cho, cedric
Reviewed By: segfaultxavi
Subscribers: zmike, woohyun, akanad, lauromoura, #reviewers, #committers
Tags: #efl_language_bindings
Maniphest Tasks: T7204
Differential Revision: https://phab.enlightenment.org/D7495
2019-01-16 03:28:36 -08:00
|
|
|
)
|
2018-10-17 04:04:07 -07:00
|
|
|
|
|
|
|
bash = find_program('bash')
|
|
|
|
|
|
|
|
map = run_command('map_generate.sh').stdout()
|
|
|
|
|
|
|
|
|
|
|
|
efl_libs = configuration_data()
|
|
|
|
efl_libs.set('EFL_MONO_LIBRARY_MAP', map)
|
|
|
|
efl_libs.set('CUSTOM_EXPORTS_MONO_DL_MONO', 'eflcustomexportsmono')
|
|
|
|
efl_libs.set('EVIL_DL_MONO', 'dl')
|
efl-mono: Correctly load dynamic libs for OSX
Summary:
OSX libs end with `.dylib`, so it made failed to load libs, for instance
dl name is `dl.dylib` making it unable to load as it was before
(`libdl.so`).
Test Plan:
Compare with master and note that this diff is able to fail on tests, and
not about importing libs.
- Configure as especified by Enlightenment man page + `-Dbindigns=mono -Ddotnet=true`:
```
meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false -Dopengl=full -Dcocoa=true -Dnls=false -Demotion-loaders-disabler=gstreamer1,libvlc,xine -Decore-imf-loaders-disabler=scim,ibus -Dbindigns=cxx,mono -Ddotnet=true --prefix=$PWD/prefix build
```
- Build normally
- Test `efl-mono-suite`
Reviewers: felipealmeida
Reviewed By: felipealmeida
Subscribers: stefan_schmidt, cedric, #reviewers, #committers, woohyun
Tags: #efl, #expertise_solutions
Differential Revision: https://phab.enlightenment.org/D12156
2020-11-25 05:40:17 -08:00
|
|
|
if sys_osx
|
|
|
|
efl_libs.set('LIBDL_DL_MONO', 'dl.dylib')
|
|
|
|
else
|
|
|
|
efl_libs.set('LIBDL_DL_MONO', 'libdl.so')
|
|
|
|
endif
|
2018-10-17 04:04:07 -07:00
|
|
|
|
|
|
|
foreach mono_libs : mono_sublibs
|
|
|
|
key = mono_libs[0].to_upper()+'_DL_MONO'
|
|
|
|
efl_libs.set(key, mono_libs[0].to_lower())
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'efl_libs.csv.in',
|
|
|
|
output: 'efl_libs.csv',
|
|
|
|
configuration: efl_libs
|
|
|
|
)
|
|
|
|
|
|
|
|
efl_src = configure_file(
|
|
|
|
input: 'efl_libs.cs.in',
|
|
|
|
output: 'efl_libs.cs',
|
|
|
|
configuration: efl_libs
|
|
|
|
)
|
2019-08-05 07:17:52 -07:00
|
|
|
|
2019-10-28 13:10:48 -07:00
|
|
|
friend_assemblies = ''
|
|
|
|
mono_friend_assemblies = get_option('mono-friend-assemblies')
|
|
|
|
if get_option('build-tests')
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
if get_option('dotnet')
|
|
|
|
mono_friend_assemblies += 'efl_sharp_test_suite'
|
|
|
|
else
|
|
|
|
mono_friend_assemblies += 'efl_mono_test'
|
2019-11-07 17:46:15 -08:00
|
|
|
mono_friend_assemblies += 'efl-mono-suite'
|
csharp: Revamp dotnet support
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
2019-11-05 12:59:01 -08:00
|
|
|
endif
|
2019-10-28 13:10:48 -07:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2019-08-05 07:17:52 -07:00
|
|
|
mono_eo_files = [
|
|
|
|
'efl_mono_model_internal.eo',
|
|
|
|
'efl_mono_model_internal_child.eo'
|
|
|
|
]
|
|
|
|
|
|
|
|
# mono_eo_c_files = []
|
|
|
|
|
|
|
|
pub_eo_file_target = []
|
|
|
|
|
|
|
|
foreach eo_file : mono_eo_files
|
|
|
|
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
|
|
|
|
input : join_paths('..', '..', '..', 'lib', 'efl_mono', eo_file),
|
|
|
|
output : [eo_file + '.h'],
|
|
|
|
depfile : eo_file + '.d',
|
|
|
|
install : false,
|
|
|
|
command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
|
|
|
|
'-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
|
|
|
|
'-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
|
|
|
|
'-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
|
|
|
|
'-gchd', '@INPUT@'])
|
|
|
|
# mono_eo_c_files += join_paths(meson.current_build_dir(), eo_file + '.c')
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
efl_mono_lib = library('eflcustomexportsmono',
|
|
|
|
[
|
|
|
|
join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_custom_exports_mono.c'),
|
2019-12-18 05:36:29 -08:00
|
|
|
join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_mono_accessors.c'),
|
2019-08-05 07:17:52 -07:00
|
|
|
join_paths('..', '..', '..', 'lib', 'efl_mono', 'efl_mono_model_internal.c'),
|
|
|
|
],
|
|
|
|
pub_eo_file_target,
|
|
|
|
install : true,
|
|
|
|
include_directories : config_dir + [include_directories(join_paths('.'))],
|
|
|
|
dependencies : [eo, eina, ecore],
|
|
|
|
version : meson.project_version()
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach eo_file : mono_eo_files
|
|
|
|
if not blacklisted_files.contains(eo_file)
|
|
|
|
mono_generator_target += custom_target('eolian_mono_gen_'+eo_file.underscorify()+'',
|
|
|
|
input : join_paths('..', '..', '..', 'lib', 'efl_mono', eo_file),
|
|
|
|
output : [eo_file + '.cs'],
|
|
|
|
command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
|
|
|
|
'--dllimport', 'eflcustomexportsmono',
|
|
|
|
'-o', join_paths(meson.current_build_dir(), eo_file + '.cs'),
|
|
|
|
'-e', get_option('mono-examples-dir'),
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
endif
|
|
|
|
endforeach
|