diff options
author | João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> | 2020-07-01 09:23:53 +0200 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-07-01 10:13:05 +0200 |
commit | 98fd37e768789ce9008a539d79b6f79ada393b90 (patch) | |
tree | 1e5195d8f073a82ae18ef13f345e71d9379ddded | |
parent | 1e06c01f823ce652de5d9b21c19d2677d2788844 (diff) |
Meson.build cleanup.
Summary:
This is a 8 commit patch, but only for a while - after agreeing with
each of the changes, it shall be squashed into a single commit.
I want to make further changes on meson.build (maybe I can end up simplifying
the build system, or just let things more organized in the end) and thought
that starting with a cleanup would be a good first step.
The changes are:
1. build: set arguments scope to project instead of globally
If we set arguments globally, it may conflict with other builds - specially
considering [meson's subprojects
feature](https://mesonbuild.com/Subprojects.html). Setting to project
arguments ensures we are only considering EFL and not leaking unwanted flags.
2. build: Fix spacing and indent
Mostly because it is not well standardized during the file - sometimes
there's spaces between tokens, sometimes there is not, etc. The same applies
to indent.
3. build: move test environment closer to test commands
Just as a matter of organization. If we're doing things for tests that don't
impact other stuff, then leave it when tests are handled.
4. build: Remove unnecessary parenthesis and == true comparisons
Less noisy redundancy: `true` is already true, and `false` is already false,
no need to re-check. Besides, reading `if sys_windows` and `if sys_windows
== true` shouldn't have different effects, as the first you can read as "if
the system is windows". It gets better when you have `not` instead of `==
false`, so for an example you could read `if not sys_windows` as "if it is
not a windows system" more naturally.
5. build: Switch pc_files to dict
Just thought it could stay a little better (since it works as a dict),
specially in the `foreach` right after.
6. **[removed to a future patch]** build: Use meson's warning_level instead of hardcoded -Wall
This way we ensure this is compiler-independant (and use the correct feature
for that, since meson even warns when configuring the build dir).
7. build: Use language args from add_project_arguments properly instead of a loop
The `language:` kwarg from `add_{project,global}_arguments` receives a list
of languages, so no need for that loop.
8. **[removed to a future patch]** build: Use '/' instead of join_paths
As it [is recommended by meson since
v0.49](https://mesonbuild.com/Release-notes-for-0-49-0.html#joining-paths-with-)
(and stays clearer IMO, specially since that's how some languages are
adopting path separation, e.g. C++'s filesystem stdlib).
Reviewers: bu5hm4n
Subscribers: vtorri, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11994
-rw-r--r-- | meson.build | 305 |
1 files changed, 154 insertions, 151 deletions
diff --git a/meson.build b/meson.build index b2c2d7ff5d..f7f392da75 100644 --- a/meson.build +++ b/meson.build | |||
@@ -10,19 +10,12 @@ endif | |||
10 | 10 | ||
11 | pkgconfig = import('pkgconfig') | 11 | pkgconfig = import('pkgconfig') |
12 | 12 | ||
13 | test_env = environment() | ||
14 | test_env.set('EFL_RUN_IN_TREE', '1') | ||
15 | |||
16 | if get_option('b_sanitize') == 'address' | ||
17 | test_env.set('ASAN_OPTIONS', 'detect_leaks=0:detect_odr_violation=0') | ||
18 | endif | ||
19 | |||
20 | version_arr = meson.project_version().split('.') | 13 | version_arr = meson.project_version().split('.') |
21 | 14 | ||
22 | version_major = version_arr[0] | 15 | version_major = version_arr[0] |
23 | version_minor = version_arr[1] | 16 | version_minor = version_arr[1] |
24 | version_micro = version_arr[2] | 17 | version_micro = version_arr[2] |
25 | version_name = 'v-'+version_major + '.' + version_minor | 18 | version_name = 'v-' + version_major + '.' + version_minor |
26 | 19 | ||
27 | cc = meson.get_compiler('c') | 20 | cc = meson.get_compiler('c') |
28 | host_os = host_machine.system() | 21 | host_os = host_machine.system() |
@@ -89,46 +82,46 @@ dev_cflags_try = [ | |||
89 | ] | 82 | ] |
90 | 83 | ||
91 | foreach cf: dev_cflags_try | 84 | foreach cf: dev_cflags_try |
92 | if cc.has_argument(cf) == true | 85 | if cc.has_argument(cf) |
93 | dev_cflags += cf | 86 | dev_cflags += cf |
94 | endif | 87 | endif |
95 | endforeach | 88 | endforeach |
96 | add_global_arguments(dev_cflags, language: 'c') | 89 | |
97 | add_global_arguments(dev_cflags, language: 'cpp') | 90 | add_project_arguments(dev_cflags, language: 'c') |
98 | 91 | add_project_arguments(dev_cflags, language: 'cpp') | |
99 | 92 | ||
100 | foreach lang : ['c', 'objc', 'cpp'] | 93 | |
101 | add_global_arguments('-DHAVE_CONFIG_H=1', language: lang) | 94 | langs = ['c', 'objc', 'cpp'] |
102 | add_global_arguments('-D_GNU_SOURCE=1', language: lang) | 95 | add_project_arguments('-DHAVE_CONFIG_H=1', language: langs) |
103 | add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: lang) | 96 | add_project_arguments('-D_GNU_SOURCE=1', language: langs) |
104 | add_global_arguments('-DNEED_RUN_IN_TREE=1', language: lang) | 97 | add_project_arguments('-DEFL_BETA_API_SUPPORT=1', language: langs) |
105 | add_global_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: lang) | 98 | add_project_arguments('-DNEED_RUN_IN_TREE=1', language: langs) |
106 | if sys_windows == true | 99 | add_project_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: langs) |
107 | add_global_arguments('-D_POSIX_C_SOURCE=200809L', language: lang) | 100 | if sys_windows |
108 | add_global_arguments('-DDLL_EXPORT=1', language: lang) | 101 | add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: langs) |
109 | if (get_option('windows-version') == 'vista') | 102 | add_project_arguments('-DDLL_EXPORT=1', language: langs) |
110 | add_global_arguments('-DWINVER=0x060', language: lang) | 103 | if get_option('windows-version') == 'vista' |
111 | add_global_arguments('-D_WIN32_WINNT=0x0600', language: lang) | 104 | add_project_arguments('-DWINVER=0x060', language: langs) |
112 | elif (get_option('windows-version') == 'win7') | 105 | add_project_arguments('-D_WIN32_WINNT=0x0600', language: langs) |
113 | add_global_arguments('-DWINVER=0x0601', language: lang) | 106 | elif get_option('windows-version') == 'win7' |
114 | add_global_arguments('-D_WIN32_WINNT=0x0601', language: lang) | 107 | add_project_arguments('-DWINVER=0x0601', language: langs) |
115 | elif (get_option('windows-version') == 'win8') | 108 | add_project_arguments('-D_WIN32_WINNT=0x0601', language: langs) |
116 | add_global_arguments('-DWINVER=0x0602', language: lang) | 109 | elif get_option('windows-version') == 'win8' |
117 | add_global_arguments('-D_WIN32_WINNT=0x0602', language: lang) | 110 | add_project_arguments('-DWINVER=0x0602', language: langs) |
118 | elif (get_option('windows-version') == 'win81') | 111 | add_project_arguments('-D_WIN32_WINNT=0x0602', language: langs) |
119 | add_global_arguments('-DWINVER=0x0603', language: lang) | 112 | elif get_option('windows-version') == 'win81' |
120 | add_global_arguments('-D_WIN32_WINNT=0x0603', language: lang) | 113 | add_project_arguments('-DWINVER=0x0603', language: langs) |
121 | elif (get_option('windows-version') == 'win10') | 114 | add_project_arguments('-D_WIN32_WINNT=0x0603', language: langs) |
122 | add_global_arguments('-DWINVER=0x0A00', language: lang) | 115 | elif get_option('windows-version') == 'win10' |
123 | add_global_arguments('-D_WIN32_WINNT=0x0A00', language: lang) | 116 | add_project_arguments('-DWINVER=0x0A00', language: langs) |
124 | else | 117 | add_project_arguments('-D_WIN32_WINNT=0x0A00', language: langs) |
125 | error('Version of targetted Windows incorrect') | 118 | else |
126 | endif | 119 | error('Version of targetted Windows incorrect') |
127 | add_global_arguments('-D__USE_MINGW_ANSI_STDIO', language: lang) | ||
128 | endif | 120 | endif |
129 | endforeach | 121 | add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: langs) |
122 | endif | ||
130 | 123 | ||
131 | if sys_sun == true | 124 | if sys_sun |
132 | # for getpwuid_r() | 125 | # for getpwuid_r() |
133 | add_global_arguments('-D_POSIX_PTHREAD_SEMANTICS', language: 'c') | 126 | add_global_arguments('-D_POSIX_PTHREAD_SEMANTICS', language: 'c') |
134 | endif | 127 | endif |
@@ -162,7 +155,7 @@ extern char **environ; | |||
162 | 155 | ||
163 | void func(void) { printf("%p\n", environ); } | 156 | void func(void) { printf("%p\n", environ); } |
164 | ''' | 157 | ''' |
165 | if cc.compiles(code, args : '-lc', name : 'environ check') == true | 158 | if cc.compiles(code, args : '-lc', name : 'environ check') |
166 | config_h.set10('HAVE_ENVIRON', true) | 159 | config_h.set10('HAVE_ENVIRON', true) |
167 | endif | 160 | endif |
168 | 161 | ||
@@ -185,21 +178,21 @@ if get_option('native-arch-optimization') | |||
185 | elif host_machine.cpu_family() == 'arm' | 178 | elif host_machine.cpu_family() == 'arm' |
186 | cpu_neon = true | 179 | cpu_neon = true |
187 | config_h.set10('BUILD_NEON', true) | 180 | config_h.set10('BUILD_NEON', true) |
188 | add_global_arguments('-mfpu=neon', language: 'c') | 181 | add_project_arguments('-mfpu=neon', language: 'c') |
189 | add_global_arguments('-ftree-vectorize', language: 'c') | 182 | add_project_arguments('-ftree-vectorize', language: 'c') |
190 | message('ARM build - NEON enabled') | 183 | message('ARM build - NEON enabled') |
191 | elif host_machine.cpu_family() == 'aarch64' | 184 | elif host_machine.cpu_family() == 'aarch64' |
192 | cpu_neon = true | 185 | cpu_neon = true |
193 | cpu_neon_intrinsics = true | 186 | cpu_neon_intrinsics = true |
194 | config_h.set10('BUILD_NEON', true) | 187 | config_h.set10('BUILD_NEON', true) |
195 | config_h.set10('BUILD_NEON_INTRINSICS', true) | 188 | config_h.set10('BUILD_NEON_INTRINSICS', true) |
196 | add_global_arguments('-ftree-vectorize', language: 'c') | 189 | add_project_arguments('-ftree-vectorize', language: 'c') |
197 | native_arch_opt_c_args = [ '-ftree-vectorize' ] | 190 | native_arch_opt_c_args = [ '-ftree-vectorize' ] |
198 | message('ARM64 build - NEON + intrinsics enabled') | 191 | message('ARM64 build - NEON + intrinsics enabled') |
199 | elif host_machine.cpu_family() == 'ppc' or host_machine.cpu_family() == 'ppc64' | 192 | elif host_machine.cpu_family() == 'ppc' or host_machine.cpu_family() == 'ppc64' |
200 | config_h.set10('BUILD_ALTIVEC', true) | 193 | config_h.set10('BUILD_ALTIVEC', true) |
201 | add_global_arguments('-ftree-vectorize', language: 'c') | 194 | add_project_arguments('-ftree-vectorize', language: 'c') |
202 | add_global_arguments('-maltivec', language: 'c') | 195 | add_project_arguments('-maltivec', language: 'c') |
203 | message('PPC/POWER build - ALTIVEC enabled') | 196 | message('PPC/POWER build - ALTIVEC enabled') |
204 | endif | 197 | endif |
205 | endif | 198 | endif |
@@ -207,33 +200,33 @@ endif | |||
207 | config_dir = [include_directories('.')] | 200 | config_dir = [include_directories('.')] |
208 | eolian_include_directories = [] | 201 | eolian_include_directories = [] |
209 | 202 | ||
210 | if sys_linux == true or sys_bsd == true or sys_sun == true | 203 | if sys_linux or sys_bsd or sys_sun |
211 | sys_lib_extension = 'so' | 204 | sys_lib_extension = 'so' |
212 | sys_exe_extension = '' | 205 | sys_exe_extension = '' |
213 | sys_mod_extension = 'so' | 206 | sys_mod_extension = 'so' |
214 | elif sys_windows == true | 207 | elif sys_windows |
215 | sys_lib_extension = 'dll' | 208 | sys_lib_extension = 'dll' |
216 | sys_exe_extension = 'exe' | 209 | sys_exe_extension = 'exe' |
217 | sys_mod_extension = 'dll' | 210 | sys_mod_extension = 'dll' |
218 | elif sys_osx == true | 211 | elif sys_osx |
219 | sys_lib_extension = 'dylib' | 212 | sys_lib_extension = 'dylib' |
220 | sys_exe_extension = '' | 213 | sys_exe_extension = '' |
221 | sys_mod_extension = 'so' | 214 | sys_mod_extension = 'so' |
222 | config_h.set('environ', '(*_NSGetEnviron())') | 215 | config_h.set('environ', '(*_NSGetEnviron())') |
223 | else | 216 | else |
224 | error('System '+host_machine.system()+' not known') | 217 | error('System ' + host_machine.system() + ' not known') |
225 | endif | 218 | endif |
226 | 219 | ||
227 | if host_os == 'freebsd' or host_os == 'dragonfly' | 220 | if host_os == 'freebsd' or host_os == 'dragonfly' |
228 | # This is necessary. We MUST use OpenSSL in base as bringing in | 221 | # This is necessary. We MUST use OpenSSL in base as bringing in from ports |
229 | # from ports can cause major issues (2 copies of the same library). | 222 | # can cause major issues (2 copies of the same library). |
230 | crypto = declare_dependency(link_args : [ '-lssl', '-lcrypto']) | 223 | crypto = declare_dependency(link_args : [ '-lssl', '-lcrypto']) |
231 | config_h.set('HAVE_OPENSSL', '1') | 224 | config_h.set('HAVE_OPENSSL', '1') |
232 | elif (get_option('crypto') == 'gnutls') | 225 | elif get_option('crypto') == 'gnutls' |
233 | # gcrypt does not want to provide a pkg config file so we try the lib | 226 | # gcrypt does not want to provide a pkg config file so we try the lib |
234 | crypto = [dependency('gnutls'), cc.find_library('gcrypt')] | 227 | crypto = [dependency('gnutls'), cc.find_library('gcrypt')] |
235 | config_h.set('HAVE_GNUTLS', '1') | 228 | config_h.set('HAVE_GNUTLS', '1') |
236 | elif (get_option('crypto') == 'openssl') | 229 | elif get_option('crypto') == 'openssl' |
237 | crypto = dependency('openssl') | 230 | crypto = dependency('openssl') |
238 | config_h.set('HAVE_OPENSSL', '1') | 231 | config_h.set('HAVE_OPENSSL', '1') |
239 | endif | 232 | endif |
@@ -243,22 +236,22 @@ if get_option('crypto') != '' | |||
243 | config_h.set('HAVE_SIGNATURE', '1') | 236 | config_h.set('HAVE_SIGNATURE', '1') |
244 | endif | 237 | endif |
245 | 238 | ||
246 | config_h.set_quoted('SHARED_LIB_SUFFIX', '.'+sys_lib_extension) | 239 | config_h.set_quoted('SHARED_LIB_SUFFIX', '.' + sys_lib_extension) |
247 | config_h.set_quoted('MOD_SUFFIX', '.'+sys_mod_extension) | 240 | config_h.set_quoted('MOD_SUFFIX', '.' + sys_mod_extension) |
248 | if sys_exe_extension == '' | 241 | if sys_exe_extension == '' |
249 | config_h.set_quoted('EXE_SUFFIX', '') | 242 | config_h.set_quoted('EXE_SUFFIX', '') |
250 | else | 243 | else |
251 | config_h.set_quoted('EXE_SUFFIX', '.'+sys_exe_extension) | 244 | config_h.set_quoted('EXE_SUFFIX', '.' + sys_exe_extension) |
252 | endif | 245 | endif |
253 | 246 | ||
254 | if get_option('tslib') == true | 247 | if get_option('tslib') |
255 | config_h.set('HAVE_TSLIB', '1') | 248 | config_h.set('HAVE_TSLIB', '1') |
256 | endif | 249 | endif |
257 | 250 | ||
258 | subdir('header_checks') | 251 | subdir('header_checks') |
259 | subdir('po') | 252 | subdir('po') |
260 | 253 | ||
261 | if get_option('wl') == true | 254 | if get_option('wl') |
262 | subdir(join_paths('src', 'wayland_protocol')) | 255 | subdir(join_paths('src', 'wayland_protocol')) |
263 | endif | 256 | endif |
264 | 257 | ||
@@ -267,13 +260,13 @@ ecore_evas_wayland_engine_include_dir = [] | |||
267 | evas_static_list = [] | 260 | evas_static_list = [] |
268 | 261 | ||
269 | luaold_interpreters = [ | 262 | luaold_interpreters = [ |
270 | ['lua', ['>=5.1.0','<5.3.0']], | 263 | ['lua', ['>=5.1.0', '<5.3.0']], |
271 | ['lua51', ['>=5.1.0','<5.2.0']], | 264 | ['lua51', ['>=5.1.0', '<5.2.0']], |
272 | ['lua-5.1', ['>=5.1.0','<5.2.0']], | 265 | ['lua-5.1', ['>=5.1.0', '<5.2.0']], |
273 | ['lua5.1', ['>=5.1.0','<5.2.0']], | 266 | ['lua5.1', ['>=5.1.0', '<5.2.0']], |
274 | ['lua52', ['>=5.2.0','<5.3.0']], | 267 | ['lua52', ['>=5.2.0', '<5.3.0']], |
275 | ['lua-5.2', ['>=5.2.0','<5.3.0']], | 268 | ['lua-5.2', ['>=5.2.0', '<5.3.0']], |
276 | ['lua5.2', ['>=5.2.0','<5.3.0']], | 269 | ['lua5.2', ['>=5.2.0', '<5.3.0']], |
277 | ] | 270 | ] |
278 | 271 | ||
279 | lua_pc_name = '' | 272 | lua_pc_name = '' |
@@ -284,7 +277,7 @@ if get_option('lua-interpreter') == 'lua' | |||
284 | foreach l : luaold_interpreters | 277 | foreach l : luaold_interpreters |
285 | lua = dependency(l[0], version: l[1], required:false) | 278 | lua = dependency(l[0], version: l[1], required:false) |
286 | lua_pc_name = l[0] | 279 | lua_pc_name = l[0] |
287 | if lua.found() == true | 280 | if lua.found() |
288 | break | 281 | break |
289 | endif | 282 | endif |
290 | endforeach | 283 | endforeach |
@@ -307,63 +300,65 @@ else | |||
307 | lua_pc_name = 'luajit' | 300 | lua_pc_name = 'luajit' |
308 | endif | 301 | endif |
309 | 302 | ||
310 | if sys_osx == true and get_option('lua-interpreter') == 'luajit' | 303 | if sys_osx and get_option('lua-interpreter') == 'luajit' |
311 | # luajit on macos is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy | 304 | # luajit on macro is broken, this means we need to generate our own |
305 | # dependency with our arguments, a library later still needs to link to | ||
306 | # luajit for the pagesize argument thingy | ||
312 | lua = declare_dependency( | 307 | lua = declare_dependency( |
313 | include_directories: include_directories(lua.get_pkgconfig_variable('includedir')), | 308 | include_directories: include_directories(lua.get_pkgconfig_variable('includedir')), |
314 | link_args: ['-L'+lua.get_pkgconfig_variable('libdir'), '-l'+lua.get_pkgconfig_variable('libname')] | 309 | link_args: ['-L' + lua.get_pkgconfig_variable('libdir'), '-l' + lua.get_pkgconfig_variable('libname')] |
315 | ) | 310 | ) |
316 | endif | 311 | endif |
317 | 312 | ||
318 | subprojects = [ | 313 | subprojects = [ |
319 | # name | option | mod | lib | bin | bench | tests | examples | true if build in efl-one | pkg-config options | name of static libs | 314 | # name | option | mod | lib | bin | bench | tests | examples | true if build in efl-one | pkg-config options | name of static libs |
320 | ['evil' ,[] , false, true, false, false, false, false, true, [], []], | 315 | ['evil' ,[] , false, true, false, false, false, false, true, [], []], |
321 | ['eina' ,[] , false, true, true, true, true, true, true, [], []], | 316 | ['eina' ,[] , false, true, true, true, true, true, true, [], []], |
322 | ['eolian' ,[] , false, true, true, false, true, false, false, ['eina'], []], | 317 | ['eolian' ,[] , false, true, true, false, true, false, false, ['eina'], []], |
323 | ['eo' ,[] , false, true, false, true, true, false, true, ['eina'], []], | 318 | ['eo' ,[] , false, true, false, true, true, false, true, ['eina'], []], |
324 | ['efl' ,[] , false, true, false, false, true, false, true, ['eo'], []], | 319 | ['efl' ,[] , false, true, false, false, true, false, true, ['eo'], []], |
325 | ['emile' ,[] , false, true, false, false, true, true, true, ['eina', 'efl'], ['lz4', 'rg_etc']], | 320 | ['emile' ,[] , false, true, false, false, true, true, true, ['eina', 'efl'], ['lz4', 'rg_etc']], |
326 | ['eet' ,[] , false, true, true, false, true, true, true, ['eina', 'emile', 'efl'], []], | 321 | ['eet' ,[] , false, true, true, false, true, true, true, ['eina', 'emile', 'efl'], []], |
327 | ['ecore' ,[] , false, true, false, false, false, false, true, ['eina', 'eo', 'efl'], ['buildsystem']], | 322 | ['ecore' ,[] , false, true, false, false, false, false, true, ['eina', 'eo', 'efl'], ['buildsystem']], |
328 | ['eldbus' ,[] , false, true, true, false, true, true, true, ['eina', 'eo', 'efl'], []], | 323 | ['eldbus' ,[] , false, true, true, false, true, true, true, ['eina', 'eo', 'efl'], []], |
329 | ['ecore' ,[] , true, false, false, false, true, true, true, ['eina', 'eo', 'efl'], []], #ecores modules depend on eldbus | 324 | ['ecore' ,[] , true, false, false, false, true, true, true, ['eina', 'eo', 'efl'], []], #ecores modules depend on eldbus |
330 | ['ecore_audio' ,['audio'] , false, true, false, false, false, false, true, ['eina', 'eo'], []], | 325 | ['ecore_audio' ,['audio'] , false, true, false, false, false, false, true, ['eina', 'eo'], []], |
331 | ['ecore_avahi' ,['avahi'] , false, true, false, false, false, true, false, ['eina', 'ecore'], []], | 326 | ['ecore_avahi' ,['avahi'] , false, true, false, false, false, true, false, ['eina', 'ecore'], []], |
332 | ['ecore_con' ,[] , false, true, true, false, true, false, true, ['eina', 'eo', 'efl', 'ecore'], ['http-parser']], | 327 | ['ecore_con' ,[] , false, true, true, false, true, false, true, ['eina', 'eo', 'efl', 'ecore'], ['http-parser']], |
333 | ['ecore_file' ,[] , false, true, false, false, false, false, true, ['eina'], []], | 328 | ['ecore_file' ,[] , false, true, false, false, false, false, true, ['eina'], []], |
334 | ['eeze' ,['eeze'] , true, true, true, false, true, false, true, ['eina', 'efl'], []], | 329 | ['eeze' ,['eeze'] , true, true, true, false, true, false, true, ['eina', 'efl'], []], |
335 | ['ecore_input' ,[] , false, true, false, false, false, false, true, ['eina', 'eo'], []], | 330 | ['ecore_input' ,[] , false, true, false, false, false, false, true, ['eina', 'eo'], []], |
336 | ['ecore_x' ,['x11'] , false, true, false, false, false, false, true, ['eina', 'efl'], []], | 331 | ['ecore_x' ,['x11'] , false, true, false, false, false, false, true, ['eina', 'efl'], []], |
337 | ['ecore_fb' ,['fb'] , false, true, false, false, false, false, true, ['eina'], []], | 332 | ['ecore_fb' ,['fb'] , false, true, false, false, false, false, true, ['eina'], []], |
338 | ['ecore_wl2' ,['wl'] , true, true, false, false, true, false, true, ['eina'], ['libdrm']], | 333 | ['ecore_wl2' ,['wl'] , true, true, false, false, true, false, true, ['eina'], ['libdrm']], |
339 | ['ecore_sdl' ,['sdl'] , false, true, false, false, false, false, true, ['eina'], []], | 334 | ['ecore_sdl' ,['sdl'] , false, true, false, false, false, false, true, ['eina'], []], |
340 | ['ecore_win32' ,[] , false, true, false, false, false, false, true, ['eina'], []], | 335 | ['ecore_win32' ,[] , false, true, false, false, false, false, true, ['eina'], []], |
341 | ['ecore_ipc' ,[] , false, true, false, false, false, false, true, ['eina'], []], | 336 | ['ecore_ipc' ,[] , false, true, false, false, false, false, true, ['eina'], []], |
342 | ['ecore_buffer' ,['buffer'] , true, true, true, false, false, false, true, ['eina'], []], | 337 | ['ecore_buffer' ,['buffer'] , true, true, true, false, false, false, true, ['eina'], []], |
343 | ['ector' ,[] , false, true, false, false, true, false, true, ['eina', 'efl'], ['draw', 'triangulator', 'freetype']], | 338 | ['ector' ,[] , false, true, false, false, true, false, true, ['eina', 'efl'], ['draw', 'triangulator', 'freetype']], |
344 | ['elput' ,['drm'] , false, true, false, false, true, false, true, ['eina', 'eldbus'], []], | 339 | ['elput' ,['drm'] , false, true, false, false, true, false, true, ['eina', 'eldbus'], []], |
345 | ['ecore_drm2' ,['drm'] , false, true, false, false, false, false, true, ['ecore'], ['libdrm']], | 340 | ['ecore_drm2' ,['drm'] , false, true, false, false, false, false, true, ['ecore'], ['libdrm']], |
346 | ['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, true, ['eina'], []], | 341 | ['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, true, ['eina'], []], |
347 | ['evas' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']], | 342 | ['evas' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']], |
348 | ['efreet' ,[] , false, true, false, false, true, false, true, ['eina', 'efl', 'eo'], []], | 343 | ['efreet' ,[] , false, true, false, false, true, false, true, ['eina', 'efl', 'eo'], []], |
349 | ['ecore_input_evas' ,[] , false, true, false, false, false, false, true, ['eina', 'evas'], []], | 344 | ['ecore_input_evas' ,[] , false, true, false, false, false, false, true, ['eina', 'evas'], []], |
350 | ['ecore_evas' ,[] , true, true, true, false, false, false, true, ['evas', 'ector'], []], | 345 | ['ecore_evas' ,[] , true, true, true, false, false, false, true, ['evas', 'ector'], []], |
351 | ['ecore_imf' ,[] , true, true, false, false, false, false, true, ['eina'], []], | 346 | ['ecore_imf' ,[] , true, true, false, false, false, false, true, ['eina'], []], |
352 | ['embryo' ,[] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []], | 347 | ['embryo' ,[] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []], |
353 | ['eio' ,[] , false, true, false, false, true, true, true, ['eina', 'eet'], []], | 348 | ['eio' ,[] , false, true, false, false, true, true, true, ['eina', 'eet'], []], |
354 | ['efreet' ,[] , false, false, true, false, false, false, true, ['eina', 'efl', 'eo'], []], | 349 | ['efreet' ,[] , false, false, true, false, false, false, true, ['eina', 'efl', 'eo'], []], |
355 | ['ecore_imf_evas' ,[] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []], | 350 | ['ecore_imf_evas' ,[] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []], |
356 | ['ephysics' ,['physics'] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []], | 351 | ['ephysics' ,['physics'] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []], |
357 | ['edje' ,[] , false, true, true, false, true, true, true, ['evas', 'eo', 'efl', lua_pc_name], []], | 352 | ['edje' ,[] , false, true, true, false, true, true, true, ['evas', 'eo', 'efl', lua_pc_name], []], |
358 | ['emotion' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], []], | 353 | ['emotion' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], []], |
359 | ['ethumb' ,[] , true, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []], | 354 | ['ethumb' ,[] , true, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []], |
360 | ['ethumb_client' ,[] , false, true, true, false, false, true, true, ['eina', 'efl', 'eo', 'ethumb'], []], | 355 | ['ethumb_client' ,[] , false, true, true, false, false, true, true, ['eina', 'efl', 'eo', 'ethumb'], []], |
361 | ['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']], | 356 | ['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']], |
362 | ['efl_canvas_wl' ,['wl'] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], | 357 | ['efl_canvas_wl' ,['wl'] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], |
363 | ['elua' ,['elua'] , false, true, true, false, true, false, false, ['eina', lua_pc_name], []], | 358 | ['elua' ,['elua'] , false, true, true, false, true, false, false, ['eina', lua_pc_name], []], |
364 | ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, false, ['eina'], []], | 359 | ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, false, ['eina'], []], |
365 | ['ecore_drm' ,['drm-deprecated'] , false, true, false, false, false, false, false, ['eina'], []], | 360 | ['ecore_drm' ,['drm-deprecated'] , false, true, false, false, false, false, false, ['eina'], []], |
366 | ['exactness' ,[] , false, false, true, false, false, false, false, ['eina, evas, eet'], []], | 361 | ['exactness' ,[] , false, false, true, false, false, false, false, ['eina, evas, eet'], []], |
367 | ] | 362 | ] |
368 | 363 | ||
369 | # We generate Efl_Config.h and config.h later, they will be available here | 364 | # We generate Efl_Config.h and config.h later, they will be available here |
@@ -373,8 +368,8 @@ config_dir += include_directories('.') | |||
373 | #the other modules require theire package | 368 | #the other modules require theire package |
374 | subdir(join_paths(local_module, 'eina')) | 369 | subdir(join_paths(local_module, 'eina')) |
375 | 370 | ||
376 | #List of dependency objects that might be disabled due to configurations | 371 | # List of dependency objects that might be disabled due to configurations |
377 | #If they are enabled, the object gets overwritten by the library file. | 372 | # If they are enabled, the object gets overwritten by the library file. |
378 | ecore_audio = declare_dependency() | 373 | ecore_audio = declare_dependency() |
379 | 374 | ||
380 | test_dirs = [] | 375 | test_dirs = [] |
@@ -391,28 +386,30 @@ foreach package : subprojects | |||
391 | package_version_name = '-'.join(package_name.split('_')) + '-' + version_major | 386 | package_version_name = '-'.join(package_name.split('_')) + '-' + version_major |
392 | automatic_pkgfile = true | 387 | automatic_pkgfile = true |
393 | if package[1].length() == 0 or get_option(package[1][0]) | 388 | if package[1].length() == 0 or get_option(package[1][0]) |
394 | config_h.set('HAVE_'+package_name.to_upper().underscorify(), '1') | 389 | config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1') |
395 | 390 | ||
396 | dir_package_include = join_paths(dir_include, package_version_name) | 391 | dir_package_include = join_paths(dir_include, package_version_name) |
397 | dir_package_modules = join_paths(dir_lib, package_name, 'modules') | 392 | dir_package_modules = join_paths(dir_lib, package_name, 'modules') |
398 | 393 | ||
399 | #ensure that we really dont copy the eo file targets from a previous library | 394 | # ensure that we really dont copy the eo file targets from a previous |
400 | #Those are the variables that can be used to reflect the libraries speical handlings | 395 | # library Those are the variables that can be used to reflect the libraries |
401 | # -> at the end is used to indicate where to find this variable outside of this for loop | 396 | # speical handlings -> at the end is used to indicate where to find this |
397 | # variable outside of this for loop | ||
402 | 398 | ||
403 | #public eo and eot files - which probebly have to be used later for bindings | 399 | # public eo and eot files - which probebly have to be used later for bindings |
404 | pub_eo_files = [] # -> package_name + '_eo_files' | 400 | pub_eo_files = [] # -> package_name + '_eo_files' |
405 | pub_eo_types_files = [] # -> package_name + '_eot_files' | 401 | pub_eo_types_files = [] # -> package_name + '_eot_files' |
406 | #All subdirs where eo files that are listed in the pub_* variables can be found | 402 | # All subdirs where eo files that are listed in the pub_* variables can be |
407 | #For every element != '' a variable called package_name + '_' + subir + '_eot_files' and package_name + '_' + subir + '_eo_files' must exist. | 403 | # found |
404 | # For every element != '' a variable called package_name + '_' + subir + '_eot_files' and package_name + '_' + subir + '_eo_files' must exist. | ||
408 | package_eo_subdirs = [''] # -> package_name + '_eo_subdirs' | 405 | package_eo_subdirs = [''] # -> package_name + '_eo_subdirs' |
409 | #All subdirs that should be included in order to include every requried header | 406 | # All subdirs that should be included in order to include every requried header |
410 | package_header_subdirs = [] # -> package_name + '_include_subdirs' | 407 | package_header_subdirs = [] # -> package_name + '_include_subdirs' |
411 | #eo file targets, this list of targets can be used to ensure the files are created before accessed | 408 | # eo file targets, this list of targets can be used to ensure the files are created before accessed |
412 | pub_eo_file_target = [] | 409 | pub_eo_file_target = [] |
413 | #private eo files target - never use this :) | 410 | # private eo files target - never use this :) |
414 | priv_eo_file_target = [] | 411 | priv_eo_file_target = [] |
415 | #use this variable to store custom variables in that should be placed in the .pc file | 412 | # use this variable to store custom variables in that should be placed in the .pc file |
416 | package_pc_variables = [] | 413 | package_pc_variables = [] |
417 | 414 | ||
418 | foreach static_lib : package[10] | 415 | foreach static_lib : package[10] |
@@ -427,7 +424,7 @@ foreach package : subprojects | |||
427 | '-DNEED_RUN_IN_TREE=1', | 424 | '-DNEED_RUN_IN_TREE=1', |
428 | '-DEFL_BUILD=1', | 425 | '-DEFL_BUILD=1', |
429 | ] | 426 | ] |
430 | if (package[3]) | 427 | if package[3] |
431 | subdir(join_paths(local_lib, package_name)) | 428 | subdir(join_paths(local_lib, package_name)) |
432 | set_variable(package_name + '_eo_files', pub_eo_files) | 429 | set_variable(package_name + '_eo_files', pub_eo_files) |
433 | set_variable(package_name + '_eot_files', pub_eo_types_files) | 430 | set_variable(package_name + '_eot_files', pub_eo_types_files) |
@@ -466,20 +463,20 @@ foreach package : subprojects | |||
466 | subdir(join_paths(local_bin, package_name)) | 463 | subdir(join_paths(local_bin, package_name)) |
467 | endif | 464 | endif |
468 | endif | 465 | endif |
469 | if (package[6]) | 466 | if package[6] |
470 | test_dirs += [package_name] | 467 | test_dirs += [package_name] |
471 | endif | 468 | endif |
472 | if (package[7]) | 469 | if package[7] |
473 | example_dirs += [package_name] | 470 | example_dirs += [package_name] |
474 | endif | 471 | endif |
475 | 472 | ||
476 | set_variable('build_'+package_name.underscorify(), true) | 473 | set_variable('build_' + package_name.underscorify(), true) |
477 | 474 | ||
478 | # generate automatic pc files for libraries | 475 | # generate automatic pc files for libraries |
479 | if automatic_pkgfile == true and package[3] | 476 | if automatic_pkgfile and package[3] |
480 | tmp_lib = get_variable(package_name+'_lib') | 477 | tmp_lib = get_variable(package_name + '_lib') |
481 | tmp_deps = get_variable(package_name+'_deps') | 478 | tmp_deps = get_variable(package_name + '_deps') |
482 | tmp_pub_deps = get_variable(package_name+'_pub_deps') | 479 | tmp_pub_deps = get_variable(package_name + '_pub_deps') |
483 | tmp_package_subdirs = [] | 480 | tmp_package_subdirs = [] |
484 | 481 | ||
485 | foreach subdir : package_header_subdirs | 482 | foreach subdir : package_header_subdirs |
@@ -584,6 +581,14 @@ subdir(join_paths('data')) | |||
584 | 581 | ||
585 | if get_option('build-tests') | 582 | if get_option('build-tests') |
586 | check = dependency('check') | 583 | check = dependency('check') |
584 | |||
585 | test_env = environment() | ||
586 | test_env.set('EFL_RUN_IN_TREE', '1') | ||
587 | |||
588 | if get_option('b_sanitize') == 'address' | ||
589 | test_env.set('ASAN_OPTIONS', 'detect_leaks=0:detect_odr_violation=0') | ||
590 | endif | ||
591 | |||
587 | subdir(join_paths('src', 'tests')) | 592 | subdir(join_paths('src', 'tests')) |
588 | foreach test : test_dirs | 593 | foreach test : test_dirs |
589 | package_c_args = [ | 594 | package_c_args = [ |
@@ -631,7 +636,7 @@ efl_config_h.set('EFL_VERSION_MINOR', version_minor) | |||
631 | efl_config_h.set('EFL_VERSION_MICRO', version_micro) | 636 | efl_config_h.set('EFL_VERSION_MICRO', version_micro) |
632 | efl_config_h.set('EFL_BUILD_ID', get_option('build-id')) | 637 | efl_config_h.set('EFL_BUILD_ID', get_option('build-id')) |
633 | 638 | ||
634 | #FIXME placeholder | 639 | # FIXME placeholder |
635 | efl_config_h.set('EFL_API_LEGACY_DEF', '#define EFL_API_LEGACY_DEF "FIXME NOT IMPLEMENTED"') | 640 | efl_config_h.set('EFL_API_LEGACY_DEF', '#define EFL_API_LEGACY_DEF "FIXME NOT IMPLEMENTED"') |
636 | 641 | ||
637 | configure_file( | 642 | configure_file( |
@@ -657,15 +662,13 @@ subdir(join_paths('systemd-services')) | |||
657 | subdir(join_paths('dbus-services')) | 662 | subdir(join_paths('dbus-services')) |
658 | 663 | ||
659 | #output the three new efl-* .pc files | 664 | #output the three new efl-* .pc files |
660 | efl_20_pc_files = [ | 665 | efl_20_pc_files = { |
661 | ['efl-ui', ['elementary']], | 666 | 'efl-ui' : ['elementary'], |
662 | ['efl-core', ['ecore', 'efl', 'emile']], | 667 | 'efl-core' : ['ecore', 'efl', 'emile'], |
663 | ['efl-net', ['ecore', 'ecore-con', 'emile']], | 668 | 'efl-net' : ['ecore', 'ecore-con', 'emile'], |
664 | ] | 669 | } |
665 | 670 | ||
666 | foreach pc_file : efl_20_pc_files | 671 | foreach name, libraries : efl_20_pc_files |
667 | name = pc_file[0] | ||
668 | libraries = pc_file[1] | ||
669 | pkgconfig.generate( | 672 | pkgconfig.generate( |
670 | name : '-'.join(name.split('_')), | 673 | name : '-'.join(name.split('_')), |
671 | description: name+' configutation file', | 674 | description: name+' configutation file', |