efl

Форк
0
/
meson.build 
128 строк · 5.0 Кб
1

2
# ['eina', 'eolian', 'eo'] those three are build in the root meson.build reason for this is the super special handling
3
cxx_sublibs = [
4
  ['Eina',        true,  true, false, [eo]],
5
  ['Eolian',      true,  true, false, []],
6
  ['Eo',          true,  true, false, []],
7
  ['Efl',         true, false,  true, []],
8
  ['Ecore',       true,  true,  true, []],
9
  ['Eet',         true,  true, false, []],
10
  ['Eio',        false, false,  true, []],
11
  ['Evas',       false,  true,  true, []],
12
  ['Edje',       false, false,  true, []],
13
  ['Eldbus',      true,  true,  true, []],
14
  ['Elementary',  true,  true,  true, []]
15
]
16

17
increased_dependency = []
18
growing_deps = []
19

20
foreach lib : cxx_sublibs
21
  package_name = lib[0].to_lower()
22
  package_top_header = lib[3]
23
  package_has_tests = lib[2]
24
  package_manual_binded = lib[1]
25
  package_version_name = '-'.join(package_name.split('_')) + '-cxx-' + version_major
26
  tmp_package_subdirs = [package_version_name]
27

28
  package_c_args = [
29
    '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
30
    '-DNEED_RUN_IN_TREE=1'
31
  ]
32

33
  dir_package_modules = join_paths(dir_lib, package_name, 'modules')
34
  cxx_generator_target = []
35
  cxx_header_src = []
36
  file_location = join_paths('..', '..', 'lib', package_name)
37
  eo_file_list = []
38
  eo_file_subdirs = get_variable(package_name + '_eo_subdirs')
39
  #generate files for each .eo files
40
  foreach eo_file_subdir : eo_file_subdirs
41
    if eo_file_subdir != ''
42
      cxx_pub_eot_files = get_variable(package_name + '_' + eo_file_subdir +'_eot_files')
43
    else
44
      cxx_pub_eot_files = get_variable(package_name +'_eot_files')
45
    endif
46
    subdir_file_location = join_paths(file_location, eo_file_subdir)
47
    foreach cxx_gen_file : cxx_pub_eot_files
48
      cxx_generator_target += custom_target('eolian_cxx_gen_'+cxx_gen_file.underscorify()+'',
49
        input : join_paths(subdir_file_location, cxx_gen_file),
50
        output : [cxx_gen_file + '.hh'],
51
        install : true,
52
        install_dir : join_paths(dir_include, package_version_name, eo_file_subdir),
53
        command : [eolian_cxx_gen, '-I', meson.current_source_dir(), eolian_include_directories,
54
                                   '-o', join_paths(meson.current_build_dir(), cxx_gen_file + '.hh'),
55
                                   '@INPUT@'])
56
      eo_file_list += files(join_paths(subdir_file_location, cxx_gen_file))
57
    endforeach
58

59
    if eo_file_subdir != ''
60
      cxx_pub_eo_files = get_variable(package_name + '_' + eo_file_subdir +'_eo_files')
61
    else
62
      cxx_pub_eo_files = get_variable(package_name +'_eo_files')
63
    endif
64
    subdir_file_location = join_paths(file_location, eo_file_subdir)
65
    foreach cxx_gen_file : cxx_pub_eo_files
66
      cxx_generator_target += custom_target('eolian_cxx_gen_'+cxx_gen_file.underscorify()+'',
67
        input : join_paths(subdir_file_location, cxx_gen_file),
68
        output : [cxx_gen_file + '.hh', cxx_gen_file + '.impl.hh'],
69
        install : true,
70
        install_dir : join_paths(dir_include, package_version_name, eo_file_subdir),
71
        command : [eolian_cxx_gen, '-I', meson.current_source_dir(), eolian_include_directories,
72
                                   '-o', join_paths(meson.current_build_dir(), cxx_gen_file + '.hh'),
73
                                   '@INPUT@'])
74
      eo_file_list += files(join_paths(subdir_file_location, cxx_gen_file))
75
    endforeach
76
  endforeach
77

78
  #generate the package.eo.hh file
79
  if package_top_header
80
    cxx_generator_target += custom_target('eolian_cxx_gen_'+package_name+'.eo.hh',
81
          input : eo_file_list,
82
          output : [lib[0] + '.eo.hh'],
83
          install : true,
84
          install_dir : join_paths(dir_include, package_version_name),
85
          command : [eolian_cxx_gen, '-I', meson.current_source_dir(), eolian_include_directories, '-m',
86
                                     '-o', '@OUTPUT@',
87
                                     '@INPUT@'])
88
  endif
89

90
  if package_manual_binded
91
    inc_dir = include_directories(package_name+'_cxx', '.')
92
    subdir(package_name+'_cxx')
93
  else
94
    inc_dir = include_directories(file_location, '.')
95
    cxx_header_src += files(join_paths(file_location, lib[0]+'.hh'))
96
  endif
97

98
  dep = declare_dependency(
99
    include_directories: inc_dir,
100
    sources : cxx_generator_target,
101
    dependencies: [get_variable(package_name)] + get_variable(package_name + '_pub_deps') + lib[4] + increased_dependency
102
  )
103

104
  increased_dependency += dep
105

106
  set_variable(package_name + '_cxx', dep)
107

108
  if package_has_tests
109
    test_dirs += package_name + '_cxx'
110
  endif
111

112
  foreach subdir : get_variable(package_name + '_eo_subdirs')
113
    tmp_package_subdirs += join_paths(package_version_name, subdir)
114
  endforeach
115

116
  install_headers(cxx_header_src,
117
    subdir: package_version_name,
118
  )
119

120
  pkgconfig.generate(
121
    name : '-'.join(package_name.split('_')) + '-cxx',
122
    description : lib[0]+' cxx bindings',
123
    subdirs : tmp_package_subdirs,
124
    version : version_major + '.' + version_minor + '.' + version_micro,
125
    libraries : dep,
126
    requires : growing_deps + [package_name],
127
  )
128
  growing_deps += package_name + '-cxx'
129
endforeach
130

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.