efl
/
meson.build
679 строк · 26.7 Кб
1project('efl', ['c','cpp'],
2version: '1.27.99',
3default_options : ['buildtype=plain', 'warning_level=1', 'cpp_std=c++11'],
4meson_version : '>=0.50'
5)
6
7if host_machine.system() == 'darwin'
8add_languages('objc')
9endif
10
11pkgconfig = import('pkgconfig')
12
13version_arr = meson.project_version().split('.')
14
15version_major = version_arr[0]
16version_minor = version_arr[1]
17version_micro = version_arr[2]
18version_name = 'v-' + version_major + '.' + version_minor
19
20cc = meson.get_compiler('c')
21host_os = host_machine.system()
22
23if host_os == 'linux'
24if cc.has_header_symbol('features.h', '__UCLIBC__')
25host_os = 'linux-uclibc'
26elif cc.has_header_symbol('features.h', '__dietlibc__')
27host_os = 'linux-dietlibc'
28else
29host_os = 'linux-gnu'
30endif
31endif
32
33#prepare a special linker args flag for binaries on macos
34bin_linker_args = []
35if host_machine.system() == 'darwin'
36bin_linker_args = ['-pagezero_size', '10000', '-image_base', '100000000']
37endif
38
39windows = ['windows', 'cygwin']
40#bsd for meson 0.46 and 0.47
41bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
42linux = ['linux']
43osx = ['darwin']
44sun = ['sunos']
45
46sys_linux = linux.contains(host_machine.system())
47sys_bsd = bsd.contains(host_machine.system())
48sys_windows = windows.contains(host_machine.system())
49sys_osx = osx.contains(host_machine.system())
50sys_sun = sun.contains(host_machine.system())
51
52module_files = []
53evas_loader_map = []
54
55#install paths
56dir_prefix = get_option('prefix')
57dir_sysconf = join_paths(dir_prefix, get_option('sysconfdir'))
58dir_bin = join_paths(dir_prefix, get_option('bindir'))
59dir_data = join_paths(dir_prefix, get_option('datadir'))
60dir_include = join_paths(dir_prefix, get_option('includedir'))
61dir_lib = join_paths(dir_prefix, get_option('libdir'))
62
63#local paths
64local_lib = join_paths('src', 'lib')
65local_bindings = join_paths('src', 'bindings')
66local_bin = join_paths('src', 'bin')
67local_module = join_paths('src', 'modules')
68local_tests = join_paths('src', 'tests')
69local_benchmark = join_paths('src', 'benchmarks')
70local_examples = join_paths('src', 'examples')
71local_scripts = join_paths('src', 'scripts')
72
73dev_cflags = []
74dev_cflags_try = [
75'-fvisibility=hidden',
76'-Wfloat-compare',
77'-Wpointer-arith',
78'-Wunused-parameter',
79'-Wsign-compare',
80'-Wno-missing-field-initializers',
81]
82
83foreach cf: dev_cflags_try
84if cc.has_argument(cf)
85dev_cflags += cf
86endif
87endforeach
88
89add_project_arguments(dev_cflags, language: 'c')
90add_project_arguments(dev_cflags, language: 'cpp')
91
92
93langs = ['c', 'objc', 'cpp']
94add_project_arguments('-DHAVE_CONFIG_H=1', language: langs)
95add_project_arguments('-D_GNU_SOURCE=1', language: langs)
96add_project_arguments('-DEFL_BETA_API_SUPPORT=1', language: langs)
97add_project_arguments('-DNEED_RUN_IN_TREE=1', language: langs)
98add_project_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: langs)
99if sys_windows
100add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: langs)
101add_project_arguments('-DDLL_EXPORT=1', language: langs)
102if get_option('windows-version') == 'vista'
103add_project_arguments('-DWINVER=0x060', language: langs)
104add_project_arguments('-D_WIN32_WINNT=0x0600', language: langs)
105elif get_option('windows-version') == 'win7'
106add_project_arguments('-DWINVER=0x0601', language: langs)
107add_project_arguments('-D_WIN32_WINNT=0x0601', language: langs)
108elif get_option('windows-version') == 'win8'
109add_project_arguments('-DWINVER=0x0602', language: langs)
110add_project_arguments('-D_WIN32_WINNT=0x0602', language: langs)
111elif get_option('windows-version') == 'win81'
112add_project_arguments('-DWINVER=0x0603', language: langs)
113add_project_arguments('-D_WIN32_WINNT=0x0603', language: langs)
114elif get_option('windows-version') == 'win10'
115add_project_arguments('-DWINVER=0x0A00', language: langs)
116add_project_arguments('-D_WIN32_WINNT=0x0A00', language: langs)
117else
118error('Version of targetted Windows incorrect')
119endif
120add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: langs)
121add_global_arguments('-define:WIN32', language: 'cs')
122endif
123
124if sys_sun
125# for getpwuid_r()
126add_global_arguments('-D_POSIX_PTHREAD_SEMANTICS', language: 'c')
127endif
128
129env = find_program('env', native: true)
130
131config_h = configuration_data()
132config_h.set_quoted('MODULE_ARCH', version_name)
133config_h.set_quoted('PACKAGE', meson.project_name())
134config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
135config_h.set_quoted('VERSION', meson.project_version())
136config_h.set_quoted('LOCALE_DIR', join_paths([dir_prefix, 'share/locale']))
137config_h.set_quoted('PACKAGE_URL', 'https://www.enlightenment.org')
138config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
139config_h.set_quoted('PACKAGE_BUGREPORT', 'enlightenment-devel@lists.sourceforge.net')
140config_h.set_quoted('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
141config_h.set_quoted('PACKAGE_NAME', meson.project_name())
142config_h.set_quoted('PACKAGE_BIN_DIR', dir_bin)
143config_h.set_quoted('PACKAGE_LIB_DIR', dir_lib)
144config_h.set_quoted('PACKAGE_SRC_DIR', meson.source_root())
145config_h.set_quoted('PACKAGE_BUILD_DIR', meson.current_build_dir())
146config_h.set_quoted('PACKAGE_SYSCONF_DIR', dir_sysconf)
147config_h.set_quoted('BINDIR', dir_bin)
148config_h.set10('EFL_HAVE_THREADS', true)
149config_h.set10('SLOPPY_SPEC', true)
150
151## have to get compiler again for this to work
152code = '''#define _GNU_SOURCE 1
153#include <unistd.h>
154#include <stdio.h>
155
156extern char **environ;
157
158void func(void) { printf("%p\n", environ); }
159'''
160if cc.compiles(code, args : '-lc', name : 'environ check')
161config_h.set10('HAVE_ENVIRON', true)
162endif
163
164cpu_sse3 = false
165cpu_neon = false
166cpu_neon_intrinsics = false
167native_arch_opt_c_args = [ ]
168
169if host_machine.endian() == 'big'
170config_h.set10('WORDS_BIGENDIAN', true)
171endif
172
173if get_option('native-arch-optimization')
174if host_machine.cpu_family() == 'x86' or host_machine.cpu_family() == 'x86_64'
175cpu_sse3 = true
176config_h.set10('BUILD_MMX', true)
177config_h.set10('BUILD_SSE3', true)
178native_arch_opt_c_args = [ '-msse3' ]
179message('x86 build - MMX + SSE3 enabled')
180elif host_machine.cpu_family() == 'arm'
181cpu_neon = true
182config_h.set10('BUILD_NEON', true)
183add_project_arguments('-mfpu=neon', language: 'c')
184add_project_arguments('-ftree-vectorize', language: 'c')
185message('ARM build - NEON enabled')
186elif host_machine.cpu_family() == 'aarch64'
187cpu_neon = true
188cpu_neon_intrinsics = true
189config_h.set10('BUILD_NEON', true)
190config_h.set10('BUILD_NEON_INTRINSICS', true)
191add_project_arguments('-ftree-vectorize', language: 'c')
192native_arch_opt_c_args = [ '-ftree-vectorize' ]
193message('ARM64 build - NEON + intrinsics enabled')
194elif host_machine.cpu_family() == 'ppc' or host_machine.cpu_family() == 'ppc64'
195config_h.set10('BUILD_ALTIVEC', true)
196add_project_arguments('-ftree-vectorize', language: 'c')
197add_project_arguments('-maltivec', language: 'c')
198message('PPC/POWER build - ALTIVEC enabled')
199endif
200endif
201
202config_dir = [include_directories('.')]
203eolian_include_directories = []
204
205if sys_linux or sys_bsd or sys_sun
206sys_lib_extension = 'so'
207sys_exe_extension = ''
208sys_mod_extension = 'so'
209elif sys_windows
210sys_lib_extension = 'dll'
211sys_exe_extension = 'exe'
212sys_mod_extension = 'dll'
213elif sys_osx
214sys_lib_extension = 'dylib'
215sys_exe_extension = ''
216sys_mod_extension = 'so'
217config_h.set('environ', '(*_NSGetEnviron())')
218else
219error('System ' + host_machine.system() + ' not known')
220endif
221
222if sys_linux or sys_bsd or sys_sun
223config_h.set('_STAT_VER_LINUX', '1')
224endif
225
226if 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).
229crypto = declare_dependency(link_args : [ '-lssl', '-lcrypto'])
230config_h.set('HAVE_OPENSSL', '1')
231elif get_option('crypto') == 'openssl'
232crypto = dependency('openssl')
233config_h.set('HAVE_OPENSSL', '1')
234endif
235
236if get_option('crypto') != ''
237config_h.set('HAVE_CIPHER', '1')
238config_h.set('HAVE_SIGNATURE', '1')
239endif
240
241config_h.set_quoted('SHARED_LIB_SUFFIX', '.' + sys_lib_extension)
242config_h.set_quoted('MOD_SUFFIX', '.' + sys_mod_extension)
243if sys_exe_extension == ''
244config_h.set_quoted('EXE_SUFFIX', '')
245else
246config_h.set_quoted('EXE_SUFFIX', '.' + sys_exe_extension)
247endif
248
249if get_option('tslib')
250config_h.set('HAVE_TSLIB', '1')
251endif
252
253subdir('header_checks')
254subdir('po')
255
256if get_option('wl')
257subdir(join_paths('src', 'wayland_protocol'))
258endif
259
260ecore_evas_wayland_engine_include_dir = []
261
262evas_static_list = []
263
264luaold_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
274lua_pc_name = ''
275have_elua = get_option('elua')
276
277if get_option('lua-interpreter') == 'lua'
278config_h.set('ENABLE_LUA_OLD', '1')
279foreach l : luaold_interpreters
280lua = dependency(l[0], version: l[1], required:false)
281lua_pc_name = l[0]
282if lua.found()
283break
284endif
285endforeach
286if not lua.found()
287error('Lua not found')
288endif
289if have_elua
290message('Using experimental Elua with interpreter support...')
291endif
292else
293lua = dependency(get_option('lua-interpreter'))
294lua_pc_name = 'luajit'
295endif
296
297if 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
301lua = declare_dependency(
302include_directories: include_directories(lua.get_pkgconfig_variable('includedir')),
303link_args: ['-L' + lua.get_pkgconfig_variable('libdir'), '-l' + lua.get_pkgconfig_variable('libname')]
304)
305endif
306
307subprojects = [
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
359config_dir += include_directories('.')
360
361#we have to do that first, eina modules are required by eina
362#the other modules require theire package
363subdir(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.
367ecore_audio = declare_dependency()
368
369test_dirs = []
370example_dirs = []
371efl_one_parts = []
372efl_one_deps = []
373efl_one_eo_deps = []
374efl_one_include_dirs = []
375efl_one_sub_dirs = []
376tmp_empty = declare_dependency()
377
378foreach package : subprojects
379package_name = package[0]
380package_version_name = '-'.join(package_name.split('_')) + '-' + version_major
381automatic_pkgfile = true
382if package[1].length() == 0 or get_option(package[1][0])
383config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1')
384
385dir_package_include = join_paths(dir_include, package_version_name)
386dir_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
394pub_eo_files = [] # -> package_name + '_eo_files'
395pub_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.
399package_eo_subdirs = [''] # -> package_name + '_eo_subdirs'
400# All subdirs that should be included in order to include every requried header
401package_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
403pub_eo_file_target = []
404# private eo files target - never use this :)
405priv_eo_file_target = []
406# use this variable to store custom variables in that should be placed in the .pc file
407package_pc_variables = []
408
409foreach static_lib : package[10]
410if get_variable(static_lib, tmp_empty) == tmp_empty
411subdir(join_paths('src', 'static_libs', static_lib))
412endif
413endforeach
414
415#package_c_args definition for lib and module
416package_c_args = [
417'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
418'-DNEED_RUN_IN_TREE=1',
419'-DEFL_BUILD=1',
420]
421if package[3]
422subdir(join_paths(local_lib, package_name))
423set_variable(package_name + '_eo_files', pub_eo_files)
424set_variable(package_name + '_eot_files', pub_eo_types_files)
425set_variable(package_name + '_header_subdirs', package_header_subdirs)
426set_variable(package_name + '_eo_subdirs', package_eo_subdirs)
427if (package[8] and get_option('efl-one'))
428src = get_variable(package_name+'_src')
429external_deps = get_variable(package_name+'_ext_deps')
430efl_one_include_dirs += [include_directories('.'), include_directories(join_paths(local_lib, package_name))]
431
432foreach subdirs : package_eo_subdirs
433efl_one_include_dirs += include_directories(join_paths(local_lib, package_name))
434endforeach
435
436tmp = static_library('efl_one_part_'+package_name,
437src, pub_eo_file_target, priv_eo_file_target,
438include_directories: efl_one_include_dirs,
439dependencies: external_deps + efl_one_eo_deps,
440c_args : package_c_args,
441)
442# dependency for all the .eo file targets
443efl_one_eo_deps += declare_dependency(
444sources: 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)
446efl_one_deps += external_deps
447efl_one_parts += tmp
448endif
449endif
450#special case for eolian, this is never efl-one, but will be required in the library
451if (package_name == 'eolian')
452package_c_args = [
453'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
454'-DNEED_RUN_IN_TREE=1',
455]
456if (package[4])
457subdir(join_paths(local_bin, package_name))
458endif
459endif
460if package[6]
461test_dirs += [package_name]
462endif
463if package[7]
464example_dirs += [package_name]
465endif
466
467set_variable('build_' + package_name.underscorify(), true)
468
469# generate automatic pc files for libraries
470if automatic_pkgfile and package[3]
471tmp_lib = get_variable(package_name + '_lib')
472tmp_deps = get_variable(package_name + '_deps')
473tmp_pub_deps = get_variable(package_name + '_pub_deps')
474tmp_package_subdirs = []
475
476foreach subdir : package_header_subdirs
477tmp_package_subdirs += join_paths(package_version_name, subdir)
478endforeach
479if (package[8] and get_option('efl-one'))
480efl_one_sub_dirs += [package_version_name] + tmp_package_subdirs
481endif
482pkgconfig.generate(tmp_lib,
483name : '-'.join(package_name.split('_')),
484subdirs : [package_version_name] + tmp_package_subdirs,
485version : version_major + '.' + version_minor + '.' + version_micro,
486libraries : tmp_pub_deps,
487requires : package[9],
488variables : package_pc_variables
489)
490if package_name == 'ethumb_client'
491pkgconfig.generate(tmp_lib,
492name : package_name,
493subdirs : [package_version_name] + tmp_package_subdirs,
494version : version_major + '.' + version_minor + '.' + version_micro,
495libraries : tmp_pub_deps,
496requires : package[9],
497)
498endif
499endif
500else
501message(package_name+' disabled!')
502endif
503endforeach
504
505if (get_option('efl-one'))
506#building efl-one
507efl_one_lib = shared_library('efl-one',
508link_whole : efl_one_parts,
509install : true,
510version : meson.project_version(),
511)
512
513efl_one = declare_dependency(
514link_with: efl_one_lib,
515include_directories : efl_one_include_dirs,
516dependencies : [thread_dep, intl] + efl_one_eo_deps,
517version: meson.project_version()
518)
519
520pkgconfig.generate(
521name : 'efl-one',
522subdirs : efl_one_sub_dirs,
523description: 'Configureation for efl in one big fat .so',
524libraries : [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
528foreach package : subprojects
529package_name = package[0]
530if package[1].length() == 0 or get_option(package[1][0])
531if (package[3])
532if (package[8] and get_option('efl-one'))
533set_variable(package_name, efl_one)
534endif
535endif
536endif
537endforeach
538endif
539
540#delayed build of bin, modules, and benchmarks
541foreach package : subprojects
542package_name = package[0]
543if package[1].length() == 0 or get_option(package[1][0])
544dir_package_include = join_paths(dir_include, package_version_name)
545dir_package_modules = join_paths(dir_lib, package_name, 'modules')
546package_c_args = [
547'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
548'-DNEED_RUN_IN_TREE=1',
549'-DEFL_BUILD=1',
550]
551if (package[2])
552subdir(join_paths(local_module, package_name))
553endif
554package_c_args = [
555'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, package_name)+'"',
556'-DNEED_RUN_IN_TREE=1',
557]
558if (package[4] and package_name != 'eolian')
559subdir(join_paths(local_bin, package_name))
560endif
561if (package[5])
562subdir(join_paths(local_benchmark, package_name))
563endif
564endif
565endforeach
566
567#build this later, as the debug services are depending on ecore
568subdir(join_paths('src', 'bin', 'efl'))
569
570subdir(join_paths('src', 'generic', 'evas'))
571subdir('cmakeconfig')
572subdir(join_paths('src', 'bindings'))
573subdir(join_paths('src', 'edje_external'))
574subdir(join_paths('data'))
575
576if get_option('build-tests')
577check = dependency('check')
578
579if (check.version() == '0.15.1')
580error('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')
581endif
582
583test_env = environment()
584test_env.set('EFL_RUN_IN_TREE', '1')
585
586if get_option('b_sanitize') == 'address'
587test_env.set('ASAN_OPTIONS', 'detect_leaks=0:detect_odr_violation=0')
588endif
589
590subdir(join_paths('src', 'tests'))
591foreach test : test_dirs
592package_c_args = [
593'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, test)+'"',
594'-DNEED_RUN_IN_TREE=1',
595]
596subdir(join_paths(local_tests, test))
597endforeach
598endif
599
600if get_option('build-examples')
601foreach example : example_dirs
602package_c_args = [
603'-DPACKAGE_DATA_DIR="'+ join_paths(dir_data, example)+'"',
604'-DNEED_RUN_IN_TREE=1',
605]
606subdir(join_paths(local_examples, example))
607endforeach
608endif
609
610subdir(join_paths(local_scripts))
611
612meson.add_install_script('meson/meson_modules.sh', module_files)
613
614foreach evas_loader_map_inst : evas_loader_map
615evas_loader_original = evas_loader_map_inst[0]
616evas_loader_link_types = evas_loader_map_inst[1]
617
618meson.add_install_script('meson/evas_loader_conf.sh', evas_loader_original, evas_loader_link_types)
619endforeach
620
621doxygen = find_program('doxygen', required : get_option('docs'))
622if get_option('docs')
623if not doxygen.found()
624error('Need doxygen for docs')
625endif
626subdir('doc')
627endif
628
629#
630# Configure files
631#
632
633efl_config_h = configuration_data()
634efl_config_h.set('EFL_VERSION_MAJOR', version_major)
635efl_config_h.set('EFL_VERSION_MINOR', version_minor)
636efl_config_h.set('EFL_VERSION_MICRO', version_micro)
637efl_config_h.set('EFL_BUILD_ID', get_option('build-id'))
638
639# FIXME placeholder
640efl_config_h.set('EFL_API_LEGACY_DEF', '#define EFL_API_LEGACY_DEF "FIXME NOT IMPLEMENTED"')
641
642config_h.set('EFL_MAX_FD_SIZE', get_option('max-fd-size'))
643
644configure_file(
645output: 'config.h',
646configuration: config_h
647)
648
649configure_file(
650input: join_paths('src','lib', 'efl', 'Efl_Config.h.in'),
651output: 'Efl_Config.h',
652install_dir : join_paths(dir_include,'eina-'+version_major),
653configuration: efl_config_h
654)
655
656configure_file(
657input: 'elm_intro.h.in',
658output: 'elm_intro.h',
659configuration: config_h,
660install_dir : join_paths(dir_include,'elementary-'+version_major)
661)
662
663subdir(join_paths('systemd-services'))
664subdir(join_paths('dbus-services'))
665
666#output the three new efl-* .pc files
667efl_20_pc_files = {
668'efl-ui' : ['elementary'],
669'efl-core' : ['ecore', 'efl', 'emile'],
670'efl-net' : ['ecore', 'ecore-con', 'emile'],
671}
672
673foreach name, libraries : efl_20_pc_files
674pkgconfig.generate(
675name : '-'.join(name.split('_')),
676description: name+' configutation file',
677requires : libraries,
678)
679endforeach
680