summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-04 20:33:07 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-07 13:05:31 +0100
commit79ded15ad3c0074e1d378cc5a0accad2399fcc24 (patch)
tree4c41f5e2e2af30763f2ea240a5ef1c4ac14df0be
parent4a196b99d5371ec7b43a1c166436e469bd83e57c (diff)
meson: enable cross compiling
the inital work for this commit was coming from `Mark van der Putten`. In order to not have more options for this, the idea came up to use mesons autodetection using PATH. If a cross file is specified, the binaries are used from the system, rather than from the intree. (Which means --cross-file has the dependency of efl on the buildsystem) Differential Revision: https://phab.enlightenment.org/D7415
-rw-r--r--data/elementary/objects/meson.build3
-rw-r--r--src/bin/edje/meson.build11
-rw-r--r--src/bin/eet/meson.build8
-rw-r--r--src/bin/elementary/meson.build10
-rw-r--r--src/bin/eolian/meson.build10
5 files changed, 35 insertions, 7 deletions
diff --git a/data/elementary/objects/meson.build b/data/elementary/objects/meson.build
index 5e262e74d2..8fc5736c59 100644
--- a/data/elementary/objects/meson.build
+++ b/data/elementary/objects/meson.build
@@ -34,8 +34,7 @@ endforeach
34custom_target('prefs_compile', 34custom_target('prefs_compile',
35 input: 'test_prefs.epc', 35 input: 'test_prefs.epc',
36 output: 'test_prefs.epb', 36 output: 'test_prefs.epb',
37 command : ['/usr/bin/env', 'EFL_RUN_IN_TREE=1', elm_prefs_cc.full_path(), 37 command : elm_prefs_cc_exe + ['@INPUT@', '@OUTPUT@'],
38 '@INPUT@', '@OUTPUT@'],
39 depends : elm_prefs_cc, 38 depends : elm_prefs_cc,
40 install : true, 39 install : true,
41 install_dir : join_paths(dir_data, 'elementary', 'objects'), 40 install_dir : join_paths(dir_data, 'elementary', 'objects'),
diff --git a/src/bin/edje/meson.build b/src/bin/edje/meson.build
index 83e4cbbde3..24d62ead62 100644
--- a/src/bin/edje/meson.build
+++ b/src/bin/edje/meson.build
@@ -30,9 +30,14 @@ edje_cc = executable('edje_cc',
30 link_args : bin_linker_args 30 link_args : bin_linker_args
31) 31)
32 32
33env = find_program('env') 33if meson.is_cross_build()
34 34 _edje_cc = find_program('edje_cc', native: true)
35edje_cc_exe = [env, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()] 35 edje_cc_path = _edje_cc.path()
36 edje_cc_exe = [_edje_cc]
37else
38 env = find_program('env', native: true)
39 edje_cc_exe = [env, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()]
40endif
36 41
37edje_decc_src = [ 42edje_decc_src = [
38 'edje_decc.c', 43 'edje_decc.c',
diff --git a/src/bin/eet/meson.build b/src/bin/eet/meson.build
index 8997b0cc64..6f742aea6a 100644
--- a/src/bin/eet/meson.build
+++ b/src/bin/eet/meson.build
@@ -1,4 +1,4 @@
1eet_bin = executable('eet', 1_eet_bin = executable('eet',
2 'eet_main.c', 2 'eet_main.c',
3 dependencies: [eet], 3 dependencies: [eet],
4 install : true 4 install : true
@@ -8,3 +8,9 @@ install_data(['diffeet','vieet'],
8 install_mode: 'rwxr-xr-x', 8 install_mode: 'rwxr-xr-x',
9 install_dir : dir_bin 9 install_dir : dir_bin
10) 10)
11
12if meson.is_cross_build()
13 eet_bin = find_program('eet', native : true)
14else
15 eet_bin = _eet_bin
16endif
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index d345af973b..a4a8dc2d21 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -220,6 +220,16 @@ elm_prefs_cc = executable('elm_prefs_cc',
220 link_args: '-rdynamic' 220 link_args: '-rdynamic'
221) 221)
222 222
223if meson.is_cross_build()
224 _elm_prefs_cc = find_program('elm_prefs_cc', native: true)
225 elm_prefs_cc_path = _elm_prefs_cc.path()
226 elm_prefs_cc_exe = [_elm_prefs_cc]
227else
228 env = find_program('env', native: true)
229 elm_prefs_cc_exe = [env, 'EFL_RUN_IN_TREE=1', elm_prefs_cc.full_path()]
230endif
231
232
223elementary_run_src = [ 233elementary_run_src = [
224 'run.c' 234 'run.c'
225] 235]
diff --git a/src/bin/eolian/meson.build b/src/bin/eolian/meson.build
index 0714fbea85..0e2152e552 100644
--- a/src/bin/eolian/meson.build
+++ b/src/bin/eolian/meson.build
@@ -21,4 +21,12 @@ eolian_gen_bin = executable('eolian_gen',
21eolian_gen_path = eolian_gen_bin.full_path() 21eolian_gen_path = eolian_gen_bin.full_path()
22 22
23 23
24eolian_gen = [eolian_gen_bin, '-S'] 24if meson.is_cross_build()
25 _eolian_gen_bin = find_program('eolian_gen', native : true)
26 eolian_gen_path = _eolian_gen_bin.path()
27else
28 _eolian_gen_bin = eolian_gen_bin
29 eolian_gen_path = _eolian_gen_bin.full_path()
30endif
31
32eolian_gen = [_eolian_gen_bin, '-S']