efl

Форк
0
/
meson.build 
679 строк · 26.7 Кб
1
project('efl', ['c','cpp'],
2
  version: '1.27.99',
3
  default_options : ['buildtype=plain', 'warning_level=1', 'cpp_std=c++11'],
4
  meson_version : '>=0.50'
5
)
6

7
if host_machine.system() == 'darwin'
8
  add_languages('objc')
9
endif
10

11
pkgconfig = import('pkgconfig')
12

13
version_arr = meson.project_version().split('.')
14

15
version_major = version_arr[0]
16
version_minor = version_arr[1]
17
version_micro = version_arr[2]
18
version_name = 'v-' + version_major + '.' + version_minor
19

20
cc = meson.get_compiler('c')
21
host_os = host_machine.system()
22

23
if host_os == 'linux'
24
  if cc.has_header_symbol('features.h', '__UCLIBC__')
25
    host_os = 'linux-uclibc'
26
  elif cc.has_header_symbol('features.h', '__dietlibc__')
27
    host_os = 'linux-dietlibc'
28
  else
29
    host_os = 'linux-gnu'
30
  endif
31
endif
32

33
#prepare a special linker args flag for binaries on macos
34
bin_linker_args = []
35
if host_machine.system() == 'darwin'
36
  bin_linker_args = ['-pagezero_size', '10000', '-image_base', '100000000']
37
endif
38

39
windows = ['windows', 'cygwin']
40
#bsd for meson 0.46 and 0.47
41
bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
42
linux = ['linux']
43
osx = ['darwin']
44
sun = ['sunos']
45

46
sys_linux = linux.contains(host_machine.system())
47
sys_bsd = bsd.contains(host_machine.system())
48
sys_windows = windows.contains(host_machine.system())
49
sys_osx = osx.contains(host_machine.system())
50
sys_sun = sun.contains(host_machine.system())
51

52
module_files = []
53
evas_loader_map = []
54

55
#install paths
56
dir_prefix    = get_option('prefix')
57
dir_sysconf   = join_paths(dir_prefix, get_option('sysconfdir'))
58
dir_bin       = join_paths(dir_prefix, get_option('bindir'))
59
dir_data      = join_paths(dir_prefix, get_option('datadir'))
60
dir_include   = join_paths(dir_prefix, get_option('includedir'))
61
dir_lib       = join_paths(dir_prefix, get_option('libdir'))
62

63
#local paths
64
local_lib = join_paths('src', 'lib')
65
local_bindings = join_paths('src', 'bindings')
66
local_bin = join_paths('src', 'bin')
67
local_module = join_paths('src', 'modules')
68
local_tests = join_paths('src', 'tests')
69
local_benchmark = join_paths('src', 'benchmarks')
70
local_examples = join_paths('src', 'examples')
71
local_scripts = join_paths('src', 'scripts')
72

73
dev_cflags = []
74
dev_cflags_try = [
75
  '-fvisibility=hidden',
76
  '-Wfloat-compare',
77
  '-Wpointer-arith',
78
  '-Wunused-parameter',
79
  '-Wsign-compare',
80
  '-Wno-missing-field-initializers',
81
]
82

83
foreach cf: dev_cflags_try
84
  if cc.has_argument(cf)
85
    dev_cflags += cf
86
  endif
87
endforeach
88

89
add_project_arguments(dev_cflags, language: 'c')
90
add_project_arguments(dev_cflags, language: 'cpp')
91

92

93
langs = ['c', 'objc', 'cpp']
94
add_project_arguments('-DHAVE_CONFIG_H=1', language: langs)
95
add_project_arguments('-D_GNU_SOURCE=1', language: langs)
96
add_project_arguments('-DEFL_BETA_API_SUPPORT=1', language: langs)
97
add_project_arguments('-DNEED_RUN_IN_TREE=1', language: langs)
98
add_project_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: langs)
99
if sys_windows
100
  add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: langs)
101
  add_project_arguments('-DDLL_EXPORT=1', language: langs)
102
  if get_option('windows-version') == 'vista'
103
    add_project_arguments('-DWINVER=0x060', language: langs)
104
    add_project_arguments('-D_WIN32_WINNT=0x0600', language: langs)
105
  elif get_option('windows-version') == 'win7'
106
    add_project_arguments('-DWINVER=0x0601', language: langs)
107
    add_project_arguments('-D_WIN32_WINNT=0x0601', language: langs)
108
  elif get_option('windows-version') == 'win8'
109
    add_project_arguments('-DWINVER=0x0602', language: langs)
110
    add_project_arguments('-D_WIN32_WINNT=0x0602', language: langs)
111
  elif get_option('windows-version') == 'win81'
112
    add_project_arguments('-DWINVER=0x0603', language: langs)
113
    add_project_arguments('-D_WIN32_WINNT=0x0603', language: langs)
114
  elif get_option('windows-version') == 'win10'
115
    add_project_arguments('-DWINVER=0x0A00', language: langs)
116
    add_project_arguments('-D_WIN32_WINNT=0x0A00', language: langs)
117
  else
118
    error('Version of targetted Windows incorrect')
119
  endif
120
  add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: langs)
121
  add_global_arguments('-define:WIN32', language: 'cs')
122
endif
123

124
if sys_sun
125
# for getpwuid_r()
126
  add_global_arguments('-D_POSIX_PTHREAD_SEMANTICS', language: 'c')
127
endif
128

129
env = find_program('env', native: true)
130

131
config_h = configuration_data()
132
config_h.set_quoted('MODULE_ARCH', version_name)
133
config_h.set_quoted('PACKAGE', meson.project_name())
134
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
135
config_h.set_quoted('VERSION', meson.project_version())
136
config_h.set_quoted('LOCALE_DIR', join_paths([dir_prefix, 'share/locale']))
137
config_h.set_quoted('PACKAGE_URL', 'https://www.enlightenment.org')
138
config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
139
config_h.set_quoted('PACKAGE_BUGREPORT', 'enlightenment-devel@lists.sourceforge.net')
140
config_h.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
141
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
142
config_h.set_quoted('PACKAGE_BIN_DIR', dir_bin)
143
config_h.set_quoted('PACKAGE_LIB_DIR', dir_lib)
144
config_h.set_quoted('PACKAGE_SRC_DIR', meson.source_root())
145
config_h.set_quoted('PACKAGE_BUILD_DIR', meson.current_build_dir())
146
config_h.set_quoted('PACKAGE_SYSCONF_DIR', dir_sysconf)
147
config_h.set_quoted('BINDIR', dir_bin)
148
config_h.set10('EFL_HAVE_THREADS', true)
149
config_h.set10('SLOPPY_SPEC', true)
150

151
## have to get compiler again for this to work
152
code = '''#define _GNU_SOURCE 1
153
#include <unistd.h>
154
#include <stdio.h>
155

156
extern char **environ;
157

158
void func(void) { printf("%p\n", environ); }
159
'''
160
if cc.compiles(code, args : '-lc', name : 'environ check')
161
  config_h.set10('HAVE_ENVIRON', true)
162
endif
163

164
cpu_sse3 = false
165
cpu_neon = false
166
cpu_neon_intrinsics = false
167
native_arch_opt_c_args = [ ]
168

169
if host_machine.endian() == 'big'
170
  config_h.set10('WORDS_BIGENDIAN', true)
171
endif
172

173
if get_option('native-arch-optimization')
174
  if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
175
    cpu_sse3 = true
176
    config_h.set10('BUILD_MMX', true)
177
    config_h.set10('BUILD_SSE3', true)
178
    native_arch_opt_c_args = [ '-msse3' ]
179
    message('x86 build - MMX + SSE3 enabled')
180
  elif host_machine.cpu_family() == 'arm'
181
    cpu_neon = true
182
    config_h.set10('BUILD_NEON', true)
183
    add_project_arguments('-mfpu=neon', language: 'c')
184
    add_project_arguments('-ftree-vectorize', language: 'c')
185
    message('ARM build - NEON enabled')
186
  elif host_machine.cpu_family() == 'aarch64'
187
    cpu_neon = true
188
    cpu_neon_intrinsics = true
189
    config_h.set10('BUILD_NEON', true)
190
    config_h.set10('BUILD_NEON_INTRINSICS', true)
191
    add_project_arguments('-ftree-vectorize', language: 'c')
192
    native_arch_opt_c_args = [ '-ftree-vectorize' ]
193
    message('ARM64 build - NEON + intrinsics enabled')
194
  elif host_machine.cpu_family() == 'ppc' or host_machine.cpu_family() == 'ppc64'
195
    config_h.set10('BUILD_ALTIVEC', true)
196
    add_project_arguments('-ftree-vectorize', language: 'c')
197
    add_project_arguments('-maltivec', language: 'c')
198
    message('PPC/POWER build - ALTIVEC enabled')
199
  endif
200
endif
201

202
config_dir = [include_directories('.')]
203
eolian_include_directories = []
204

205
if sys_linux or sys_bsd or sys_sun
206
  sys_lib_extension = 'so'
207
  sys_exe_extension = ''
208
  sys_mod_extension = 'so'
209
elif sys_windows
210
  sys_lib_extension = 'dll'
211
  sys_exe_extension = 'exe'
212
  sys_mod_extension = 'dll'
213
elif sys_osx
214
  sys_lib_extension = 'dylib'
215
  sys_exe_extension = ''
216
  sys_mod_extension = 'so'
217
  config_h.set('environ', '(*_NSGetEnviron())')
218
else
219
  error('System ' + host_machine.system() + ' not known')
220
endif
221

222
if sys_linux or sys_bsd or sys_sun
223
  config_h.set('_STAT_VER_LINUX', '1')
224
endif
225

226
if host_os == 'freebsd' or host_os == 'dragonfly'
227
  # This is necessary. We MUST use OpenSSL in base as bringing in from ports
228
  # can cause major issues (2 copies of the same library).
229
  crypto = declare_dependency(link_args : [ '-lssl', '-lcrypto'])
230
  config_h.set('HAVE_OPENSSL', '1')
231
elif get_option('crypto') == 'openssl'
232
  crypto = dependency('openssl')
233
  config_h.set('HAVE_OPENSSL', '1')
234
endif
235

236
if get_option('crypto') != ''
237
  config_h.set('HAVE_CIPHER', '1')
238
  config_h.set('HAVE_SIGNATURE', '1')
239
endif
240

241
config_h.set_quoted('SHARED_LIB_SUFFIX', '.' + sys_lib_extension)
242
config_h.set_quoted('MOD_SUFFIX', '.' + sys_mod_extension)
243
if sys_exe_extension == ''
244
  config_h.set_quoted('EXE_SUFFIX', '')
245
else
246
  config_h.set_quoted('EXE_SUFFIX', '.' + sys_exe_extension)
247
endif
248

249
if get_option('tslib')
250
  config_h.set('HAVE_TSLIB', '1')
251
endif
252

253
subdir('header_checks')
254
subdir('po')
255

256
if get_option('wl')
257
  subdir(join_paths('src', 'wayland_protocol'))
258
endif
259

260
ecore_evas_wayland_engine_include_dir = []
261

262
evas_static_list = []
263

264
luaold_interpreters = [
265
  ['lua',     ['>=5.1.0', '<5.3.0']],
266
  ['lua51',   ['>=5.1.0', '<5.2.0']],
267
  ['lua-5.1', ['>=5.1.0', '<5.2.0']],
268
  ['lua5.1',  ['>=5.1.0', '<5.2.0']],
269
  ['lua52',   ['>=5.2.0', '<5.3.0']],
270
  ['lua-5.2', ['>=5.2.0', '<5.3.0']],
271
  ['lua5.2',  ['>=5.2.0', '<5.3.0']],
272
]
273

274
lua_pc_name = ''
275
have_elua = get_option('elua')
276

277
if get_option('lua-interpreter') == 'lua'
278
  config_h.set('ENABLE_LUA_OLD', '1')
279
  foreach l : luaold_interpreters
280
    lua = dependency(l[0], version: l[1], required:false)
281
    lua_pc_name = l[0]
282
    if lua.found()
283
      break
284
    endif
285
  endforeach
286
  if not lua.found()
287
    error('Lua not found')
288
  endif
289
  if have_elua
290
    message('Using experimental Elua with interpreter support...')
291
  endif
292
else
293
  lua = dependency(get_option('lua-interpreter'))
294
  lua_pc_name = 'luajit'
295
endif
296

297
if sys_osx and get_option('lua-interpreter') == 'luajit'
298
  # luajit on macro is broken, this means we need to generate our own
299
  # dependency with our arguments, a library later still needs to link to
300
  # luajit for the pagesize argument thingy
301
  lua = declare_dependency(
302
    include_directories: include_directories(lua.get_pkgconfig_variable('includedir')),
303
    link_args: ['-L' + lua.get_pkgconfig_variable('libdir'), '-l' + lua.get_pkgconfig_variable('libname')]
304
  )
305
endif
306

307
subprojects = [
308
  # name              |   option             | mod  | lib  | bin  | bench | tests | examples | true if build in efl-one | pkg-config options | name of static libs
309
  ['evil'             ,[]                    , false,  true, false,  false,  false,     false,  true, [], []],
310
  ['eina'             ,[]                    , false,  true,  true,   true,   true,      true,  true, [], []],
311
  ['eolian'           ,[]                    , false,  true,  true,  false,   true,     false, false, ['eina'], []],
312
  ['eo'               ,[]                    , false,  true, false,   true,   true,     false,  true, ['eina'], []],
313
  ['efl'              ,[]                    , false,  true, false,  false,   true,     false,  true, ['eo'], []],
314
  ['emile'            ,[]                    , false,  true, false,  false,   true,      true,  true, ['eina', 'efl'], ['lz4', 'rg_etc']],
315
  ['eet'              ,[]                    , false,  true,  true,  false,   true,      true,  true, ['eina', 'emile', 'efl'], []],
316
  ['ecore'            ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina', 'eo', 'efl'], ['buildsystem']],
317
  ['eldbus'           ,[]                    , false,  true,  true,  false,   true,      true,  true, ['eina', 'eo', 'efl'], []],
318
  ['ecore'            ,[]                    ,  true, false, false,  false,   true,      true,  true, ['eina', 'eo', 'efl'], []], #ecores modules depend on eldbus
319
  ['ecore_audio'      ,['audio']             , false,  true, false,  false,  false,     false,  true, ['eina', 'eo'], []],
320
  ['ecore_avahi'      ,['avahi']             , false,  true, false,  false,  false,      true, false, ['eina', 'ecore'], []],
321
  ['ecore_con'        ,[]                    , false,  true,  true,  false,   true,     false,  true, ['eina', 'eo', 'efl', 'ecore'], ['http-parser']],
322
  ['ecore_file'       ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina'], []],
323
  ['eeze'             ,['eeze']              ,  true,  true,  true,  false,   true,     false,  true, ['eina', 'efl'], []],
324
  ['ecore_input'      ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina', 'eo'], []],
325
  ['ecore_x'          ,['x11']               , false,  true, false,  false,  false,     false,  true, ['eina', 'efl'], []],
326
  ['ecore_fb'         ,['fb']                , false,  true, false,  false,  false,     false,  true, ['eina'], []],
327
  ['ecore_wl2'        ,['wl']                ,  true,  true, false,  false,   true,     false,  true, ['eina'], ['libdrm']],
328
  ['ecore_sdl'        ,['sdl']               , false,  true, false,  false,  false,     false,  true, ['eina'], []],
329
  ['ecore_win32'      ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina'], []],
330
  ['ecore_ipc'        ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina'], []],
331
  ['ecore_buffer'     ,['buffer']            ,  true,  true,  true,  false,  false,     false,  true, ['eina'], []],
332
  ['ector'            ,[]                    , false,  true, false,  false,   true,     false,  true, ['eina', 'efl'], ['draw', 'triangulator', 'freetype']],
333
  ['elput'            ,['input']             , false,  true, false,  false,   true,     false,  true, ['eina', 'eldbus'], []],
334
  ['ecore_drm2'       ,['drm']               , false,  true, false,  false,  false,     false,  true, ['ecore'], ['libdrm']],
335
  ['ecore_cocoa'      ,['cocoa']             , false,  true, false,  false,  false,     false,  true, ['eina'], []],
336
  ['evas'             ,[]                    ,  true,  true, false,  false,   true,      true,  true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']],
337
  ['efreet'           ,[]                    , false,  true, false,  false,   true,     false,  true, ['eina', 'efl', 'eo'], []],
338
  ['ecore_input_evas' ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina', 'evas'], []],
339
  ['ecore_evas'       ,[]                    ,  true,  true,  true,  false,  false,     false,  true, ['evas', 'ector'], []],
340
  ['ecore_imf'        ,[]                    ,  true,  true, false,  false,  false,     false,  true, ['eina'], []],
341
  ['embryo'           ,[]                    , false,  true,  true,  false,  false,     false,  true, ['eina', 'efl', 'eo'], []],
342
  ['eio'              ,[]                    , false,  true, false,  false,   true,      true,  true, ['eina', 'eet'], []],
343
  ['efreet'           ,[]                    , false, false,  true,  false,  false,     false,  true, ['eina', 'efl', 'eo'], []],
344
  ['ecore_imf_evas'   ,[]                    , false,  true, false,  false,  false,     false,  true, ['eina', 'efl', 'eo'], []],
345
  ['ephysics'         ,['physics']           , false,  true, false,  false,  false,     false,  true, ['eina', 'efl', 'eo'], []],
346
  ['edje'             ,[]                    , false,  true,  true,  false,   true,      true,  true, ['evas', 'eo', 'efl', lua_pc_name], []],
347
  ['emotion'          ,[]                    ,  true,  true, false,  false,   true,      true,  true, ['eina', 'efl', 'eo'], []],
348
  ['ethumb'           ,[]                    ,  true,  true,  true,  false,  false,     false,  true, ['eina', 'efl', 'eo'], []],
349
  ['ethumb_client'    ,[]                    , false,  true,  true,  false,  false,      true,  true, ['eina', 'efl', 'eo', 'ethumb'], []],
350
  ['elementary'       ,[]                    ,  true,  true,  true,   true,   true,      true,  true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']],
351
  ['efl_canvas_wl'    ,['wl']                , false,  true,  true,  false,  false,     false,  true, ['eina', 'efl', 'eo', 'evas', 'ecore'], []],
352
  ['elua'             ,['elua']              , false,  true,  true,  false,   true,     false, false, ['eina', lua_pc_name], []],
353
  ['ecore_wayland'    ,['wl-deprecated']     , false,  true, false,  false,  false,     false, false, ['eina'], []],
354
  ['ecore_drm'        ,['drm-deprecated']    , false,  true, false,  false,  false,     false, false, ['eina'], []],
355
  ['exactness'        ,[]                    , false,  false,  true, false,  false,     false, false, ['eina, evas, eet'], []],
356
]
357

358
# We generate Efl_Config.h and config.h later, they will be available here
359
config_dir += include_directories('.')
360

361
#we have to do that first, eina modules are required by eina
362
#the other modules require theire package
363
subdir(join_paths(local_module, 'eina'))
364

365
# List of dependency objects that might be disabled due to configurations
366
# If they are enabled, the object gets overwritten by the library file.
367
ecore_audio = declare_dependency()
368

369
test_dirs = []
370
example_dirs = []
371
efl_one_parts = []
372
efl_one_deps = []
373
efl_one_eo_deps = []
374
efl_one_include_dirs = []
375
efl_one_sub_dirs = []
376
tmp_empty = declare_dependency()
377

378
foreach package : subprojects
379
  package_name = package[0]
380
  package_version_name = '-'.join(package_name.split('_')) + '-' + version_major
381
  automatic_pkgfile = true
382
  if package[1].length() == 0 or get_option(package[1][0])
383
    config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1')
384

385
    dir_package_include = join_paths(dir_include, package_version_name)
386
    dir_package_modules = join_paths(dir_lib, package_name, 'modules')
387

388
    # ensure that we really dont copy the eo file targets from a previous
389
    # library Those are the variables that can be used to reflect the libraries
390
    # speical handlings -> at the end is used to indicate where to find this
391
    # variable outside of this for loop
392

393
    # public eo and eot files - which probebly have to be used later for bindings
394
    pub_eo_files = []           # -> package_name + '_eo_files'
395
    pub_eo_types_files = []     # -> package_name + '_eot_files'
396
    # All subdirs where eo files that are listed in the pub_* variables can be
397
    # found
398
    # For every element != '' a variable called package_name + '_' + subir + '_eot_files' and package_name + '_' + subir + '_eo_files' must exist.
399
    package_eo_subdirs = ['']     # -> package_name + '_eo_subdirs'
400
    # All subdirs that should be included in order to include every requried header
401
    package_header_subdirs = [] # -> package_name + '_include_subdirs'
402
    # eo file targets, this list of targets can be used to ensure the files are created before accessed
403
    pub_eo_file_target = []
404
    # private eo files target - never use this :)
405
    priv_eo_file_target = []
406
    # use this variable to store custom variables in that should be placed in the .pc file
407
    package_pc_variables = []
408

409
    foreach static_lib : package[10]
410
      if get_variable(static_lib, tmp_empty) == tmp_empty
411
        subdir(join_paths('src', 'static_libs', static_lib))
412
      endif
413
    endforeach
414

415
    #package_c_args definition for lib and module
416
    package_c_args = [
417
      '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
418
      '-DNEED_RUN_IN_TREE=1',
419
      '-DEFL_BUILD=1',
420
    ]
421
    if package[3]
422
      subdir(join_paths(local_lib, package_name))
423
      set_variable(package_name + '_eo_files', pub_eo_files)
424
      set_variable(package_name + '_eot_files', pub_eo_types_files)
425
      set_variable(package_name + '_header_subdirs', package_header_subdirs)
426
      set_variable(package_name + '_eo_subdirs', package_eo_subdirs)
427
      if (package[8] and get_option('efl-one'))
428
        src = get_variable(package_name+'_src')
429
        external_deps = get_variable(package_name+'_ext_deps')
430
        efl_one_include_dirs += [include_directories('.'), include_directories(join_paths(local_lib, package_name))]
431

432
        foreach subdirs : package_eo_subdirs
433
          efl_one_include_dirs += include_directories(join_paths(local_lib, package_name))
434
        endforeach
435

436
        tmp = static_library('efl_one_part_'+package_name,
437
            src, pub_eo_file_target, priv_eo_file_target,
438
            include_directories: efl_one_include_dirs,
439
            dependencies: external_deps + efl_one_eo_deps,
440
            c_args : package_c_args,
441
        )
442
        # dependency for all the .eo file targets
443
        efl_one_eo_deps += declare_dependency(
444
          sources: pub_eo_file_target + priv_eo_file_target, #this here *needs* to be public and private, because our binaries and modules do depend on internal headers
445
        )
446
        efl_one_deps += external_deps
447
        efl_one_parts += tmp
448
      endif
449
    endif
450
    #special case for eolian, this is never efl-one, but will be required in the library
451
    if (package_name == 'eolian')
452
      package_c_args = [
453
        '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
454
        '-DNEED_RUN_IN_TREE=1',
455
      ]
456
      if (package[4])
457
         subdir(join_paths(local_bin, package_name))
458
      endif
459
    endif
460
    if package[6]
461
       test_dirs += [package_name]
462
    endif
463
    if package[7]
464
       example_dirs += [package_name]
465
    endif
466

467
    set_variable('build_' + package_name.underscorify(), true)
468

469
    # generate automatic pc files for libraries
470
    if automatic_pkgfile and package[3]
471
      tmp_lib = get_variable(package_name + '_lib')
472
      tmp_deps = get_variable(package_name + '_deps')
473
      tmp_pub_deps = get_variable(package_name + '_pub_deps')
474
      tmp_package_subdirs = []
475

476
      foreach subdir : package_header_subdirs
477
        tmp_package_subdirs += join_paths(package_version_name, subdir)
478
      endforeach
479
      if (package[8] and get_option('efl-one'))
480
        efl_one_sub_dirs += [package_version_name] + tmp_package_subdirs
481
      endif
482
      pkgconfig.generate(tmp_lib,
483
        name : '-'.join(package_name.split('_')),
484
        subdirs : [package_version_name] + tmp_package_subdirs,
485
        version : version_major + '.' + version_minor + '.' + version_micro,
486
        libraries : tmp_pub_deps,
487
        requires : package[9],
488
        variables : package_pc_variables
489
      )
490
      if package_name == 'ethumb_client'
491
        pkgconfig.generate(tmp_lib,
492
          name : package_name,
493
          subdirs : [package_version_name] + tmp_package_subdirs,
494
          version : version_major + '.' + version_minor + '.' + version_micro,
495
          libraries : tmp_pub_deps,
496
          requires : package[9],
497
        )
498
      endif
499
    endif
500
  else
501
    message(package_name+' disabled!')
502
  endif
503
endforeach
504

505
if (get_option('efl-one'))
506
  #building efl-one
507
  efl_one_lib = shared_library('efl-one',
508
    link_whole : efl_one_parts,
509
    install : true,
510
    version : meson.project_version(),
511
  )
512

513
  efl_one = declare_dependency(
514
    link_with: efl_one_lib,
515
    include_directories : efl_one_include_dirs,
516
    dependencies : [thread_dep, intl] + efl_one_eo_deps,
517
    version: meson.project_version()
518
  )
519

520
  pkgconfig.generate(
521
    name : 'efl-one',
522
    subdirs : efl_one_sub_dirs,
523
    description: 'Configureation for efl in one big fat .so',
524
    libraries : [efl_one] + eina_pc_deps, #eina is a special case here which drags in m dl & threads
525
  )
526

527
  #overwrite all the dependencies of subprojects with efl-one, in order to link the modules and binaries to the correct .so
528
  foreach package : subprojects
529
    package_name = package[0]
530
    if package[1].length() == 0 or get_option(package[1][0])
531
      if (package[3])
532
        if (package[8] and get_option('efl-one'))
533
          set_variable(package_name, efl_one)
534
        endif
535
      endif
536
    endif
537
  endforeach
538
endif
539

540
#delayed build of bin, modules, and benchmarks
541
foreach package : subprojects
542
  package_name = package[0]
543
  if package[1].length() == 0 or get_option(package[1][0])
544
    dir_package_include = join_paths(dir_include, package_version_name)
545
    dir_package_modules = join_paths(dir_lib, package_name, 'modules')
546
    package_c_args = [
547
      '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
548
      '-DNEED_RUN_IN_TREE=1',
549
      '-DEFL_BUILD=1',
550
    ]
551
    if (package[2])
552
       subdir(join_paths(local_module, package_name))
553
    endif
554
    package_c_args = [
555
      '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
556
      '-DNEED_RUN_IN_TREE=1',
557
    ]
558
    if (package[4] and package_name != 'eolian')
559
       subdir(join_paths(local_bin, package_name))
560
    endif
561
    if (package[5])
562
       subdir(join_paths(local_benchmark, package_name))
563
    endif
564
  endif
565
endforeach
566

567
#build this later, as the debug services are depending on ecore
568
subdir(join_paths('src', 'bin', 'efl'))
569

570
subdir(join_paths('src', 'generic', 'evas'))
571
subdir('cmakeconfig')
572
subdir(join_paths('src', 'bindings'))
573
subdir(join_paths('src', 'edje_external'))
574
subdir(join_paths('data'))
575

576
if get_option('build-tests')
577
  check = dependency('check')
578

579
  if (check.version() == '0.15.1')
580
    error('There is a bug in check@0.15.1 which does not allow efl to be compiled with it. Please downgrade / upgrade or disable tests')
581
  endif
582

583
  test_env = environment()
584
  test_env.set('EFL_RUN_IN_TREE', '1')
585

586
  if get_option('b_sanitize') == 'address'
587
    test_env.set('ASAN_OPTIONS', 'detect_leaks=0:detect_odr_violation=0')
588
  endif
589

590
  subdir(join_paths('src', 'tests'))
591
  foreach test : test_dirs
592
    package_c_args = [
593
      '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, test)+'"',
594
      '-DNEED_RUN_IN_TREE=1',
595
    ]
596
    subdir(join_paths(local_tests, test))
597
  endforeach
598
endif
599

600
if get_option('build-examples')
601
  foreach example : example_dirs
602
    package_c_args = [
603
      '-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, example)+'"',
604
      '-DNEED_RUN_IN_TREE=1',
605
    ]
606
    subdir(join_paths(local_examples, example))
607
  endforeach
608
endif
609

610
subdir(join_paths(local_scripts))
611

612
meson.add_install_script('meson/meson_modules.sh', module_files)
613

614
foreach evas_loader_map_inst : evas_loader_map
615
  evas_loader_original = evas_loader_map_inst[0]
616
  evas_loader_link_types = evas_loader_map_inst[1]
617

618
  meson.add_install_script('meson/evas_loader_conf.sh', evas_loader_original, evas_loader_link_types)
619
endforeach
620

621
doxygen = find_program('doxygen', required : get_option('docs'))
622
if get_option('docs')
623
  if not doxygen.found()
624
    error('Need doxygen for docs')
625
  endif
626
  subdir('doc')
627
endif
628

629
#
630
# Configure files
631
#
632

633
efl_config_h = configuration_data()
634
efl_config_h.set('EFL_VERSION_MAJOR', version_major)
635
efl_config_h.set('EFL_VERSION_MINOR', version_minor)
636
efl_config_h.set('EFL_VERSION_MICRO', version_micro)
637
efl_config_h.set('EFL_BUILD_ID', get_option('build-id'))
638

639
# FIXME placeholder
640
efl_config_h.set('EFL_API_LEGACY_DEF', '#define EFL_API_LEGACY_DEF "FIXME NOT IMPLEMENTED"')
641

642
config_h.set('EFL_MAX_FD_SIZE', get_option('max-fd-size'))
643

644
configure_file(
645
  output: 'config.h',
646
  configuration: config_h
647
)
648

649
configure_file(
650
  input: join_paths('src','lib', 'efl', 'Efl_Config.h.in'),
651
  output: 'Efl_Config.h',
652
  install_dir : join_paths(dir_include,'eina-'+version_major),
653
  configuration: efl_config_h
654
)
655

656
configure_file(
657
  input: 'elm_intro.h.in',
658
  output: 'elm_intro.h',
659
  configuration: config_h,
660
  install_dir : join_paths(dir_include,'elementary-'+version_major)
661
)
662

663
subdir(join_paths('systemd-services'))
664
subdir(join_paths('dbus-services'))
665

666
#output the three new efl-* .pc files
667
efl_20_pc_files = {
668
  'efl-ui' : ['elementary'],
669
  'efl-core' : ['ecore', 'efl', 'emile'],
670
  'efl-net' : ['ecore', 'ecore-con', 'emile'],
671
}
672

673
foreach name, libraries : efl_20_pc_files
674
  pkgconfig.generate(
675
    name : '-'.join(name.split('_')),
676
    description: name+' configutation file',
677
    requires : libraries,
678
  )
679
endforeach
680

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

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

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

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