summaryrefslogtreecommitdiff
path: root/src/bindings/mono/efl_mono/meson.build
blob: fb2b2c04315127b0c4e4147876dcd43a2efff70e (plain) (blame)
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
mono_files += files(
  'efl_all.cs',
  'efl_csharp_application.cs',
  'UserModel.cs',
  'GenericModel.cs',
  'Factory.cs',
  'Bind.cs'
  )

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')

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
)

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'),
      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