summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/meson.build
blob: 52c6e3152e8491e272bb5e358bbff831513020a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo']

eo_file_targets = []

foreach eo_file : eo_files
  eo_file_targets += custom_target('eolian_gen_' + eo_file,
    input : eo_file,
    output : [eo_file + '.h'],
    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'),
                           '-gch', '@INPUT@'])
endforeach



efl_mono_native_test = library('efl_mono_native_test',
    eo_file_targets + ['libefl_mono_native_test.c'],
    dependencies : [ecore, eo, efl],
)

eo_file_targets = []

foreach mono_gen_file : eo_files
  eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
    input : mono_gen_file,
    output : [mono_gen_file + '.cs'],
    command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
                                '--dllimport', 'efl_mono_native_test',
                                '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
                                '@INPUT@'])
endforeach

efl_mono_test = library('efl_mono_test',
    eo_file_targets,
    link_with : [efl_mono],
    cs_args : extra_cs_args
)

efl_mono_src = [
     'Main.cs',
     'TestUtils.cs',
     'EinaTestData.cs',
     'StructHelpers.cs',
     'BasicDirection.cs',
     'Eina.cs',
     'Eldbus.cs',
     'Eo.cs',
     'EoPromises.cs',
     'Errors.cs',
     'Events.cs',
     'FunctionPointers.cs',
     'FunctionPointerMarshalling.cs',
     'Parts.cs',
     'Promises.cs',
     'Strbuf.cs',
     'Strings.cs',
     'Structs.cs',
     'Value.cs',
     'ValueEolian.cs',
     'Inheritance.cs',
]

efl_mono_suite = executable('efl-mono-suite',
  efl_mono_src,
  link_with : [efl_mono, efl_mono_test],
  cs_args : extra_cs_args
)

env = environment()
env.set('MONO_PATH', efl_mono_test_suite_path )

if (cs_is_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 = ''

foreach config : config_libs
  lib = get_variable(config+'_lib')
  path = lib.full_path().split('/')
  repaired_path = ''
  prev = ''

  foreach p : path
    repaired_path += prev
    prev = p+'/'
  endforeach

  load_lib += repaired_path+':'
endforeach

env.set('LD_LIBRARY_PATH', load_lib)

test('efl-mono-suite',
  efl_mono_suite,
  env : env
)