From 2d41a623b66995151897509fcf374a0eb3b1b001 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Thu, 9 Jul 2020 17:42:11 +0200 Subject: Allow to pass custom lv_conf.h and lv_drv_conf.h. --- lvgl.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lvgl.py') diff --git a/lvgl.py b/lvgl.py index c154a5e..0eadd90 100644 --- a/lvgl.py +++ b/lvgl.py @@ -73,6 +73,17 @@ def build(bld): includes.append('.') include_paths = [] + def write_stuff(stuff): + def stuff_writer(task): + task.outputs[0].write(stuff) + return stuff_writer + + lv_conf_h='lv_conf.h' + lv_drv_conf_h='lv_drv_conf.h' + + bld(rule=write_stuff(bld.env.LV_CONF), target=lv_conf_h) + bld(rule=write_stuff(bld.env.LV_DRV_CONF), target=lv_drv_conf_h) + for source in sources: source_dir = os.path.dirname(source) if source_dir not in include_paths: @@ -80,7 +91,7 @@ def build(bld): bld.stlib(target = 'lvgl', features = 'c', - cflags = ['-O2', '-g'], + cflags = ['-O2', '-g', '-DLV_CONF_INCLUDE_SIMPLE'], includes = includes, source = sources) @@ -96,6 +107,8 @@ def build(bld): for include_path in include_paths: files = os.listdir(include_path) include_headers = [os.path.join(include_path, x) for x in files if (x[-2:] == '.h')] - bld.install_files(os.path.join("${PREFIX}/" , arch_inc_path, include_path), + bld.install_files(os.path.join("${PREFIX}", arch_inc_path, include_path), include_headers) - bld.install_files('${PREFIX}/' + arch_lib_path, ["liblvgl.a"]) + bld.install_files(os.path.join('${PREFIX}', arch_lib_path), ["liblvgl.a"]) + bld.install_files(os.path.join('${PREFIX}', arch_inc_path, include_path), + [lv_conf_h, lv_drv_conf_h]) -- cgit v1.2.3