summaryrefslogtreecommitdiffstats
path: root/src/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/device')
-rw-r--r--src/device/meson.build32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/device/meson.build b/src/device/meson.build
index 8e4aa90..7a0665c 100644
--- a/src/device/meson.build
+++ b/src/device/meson.build
@@ -5,17 +5,35 @@ if get_option('fwbuild')
libpath = get_option('oledlib')
assert((libpath != ''), 'path to oled lib is empty')
+ mkesppath = get_option('makeesparduino')
+ assert((mkesppath != ''), 'path to directory with makeEspArduino.mk is empty')
+
+ esplib = get_option('esplib')
+ assert((esplib != ''), 'path esplib is empty')
+
+ board = get_option('board')
+
oledlib = []
foreach i : oledlibnames
oledlib += files(libpath + '/' + i)
endforeach
+ mkespard = files(mkesppath + '/makeEspArduino.mk')
+
assert((oledlib != []), 'oled lib not found in the supplied lib directory')
- espmake = find_program('espmake')
printf = find_program('printf')
cat = find_program('cat')
cp = find_program('cp')
+ make = find_program('make')
+ nproc = find_program('nproc', disabler : true)
+
+ if nproc.found()
+ nproc_out = run_command(nproc)
+ cpus = nproc_out.stdout().strip()
+ else
+ cpus = '2'
+ endif
fw_filenames = [
'main.ino',
@@ -55,7 +73,17 @@ if get_option('fwbuild')
fw = custom_target('fw',
output : fw_image,
input : [fw_sources, fw_conf],
- command : [espmake, '-C', builddir, '&&', cp, '/tmp/mkESP/main_d1_mini/main.bin', '@OUTDIR@/' + fw_image],
+ command : [make,
+ '-f',
+ mkespard,
+ 'ESP_ROOT=' + esplib,
+ 'BOARD=' + board, '-j' + cpus,
+ '-C',
+ builddir,
+ '&&',
+ cp,
+ '/tmp/mkESP/main_d1_mini/main.bin',
+ '@OUTDIR@/' + fw_image],
install : true,
install_dir : resource_dir)