diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-07-09 17:42:11 +0200 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-07-10 08:15:21 +0200 |
commit | 2d41a623b66995151897509fcf374a0eb3b1b001 (patch) | |
tree | 2394a6c5279bbda874d06d035a180cd05a5ba445 | |
parent | lvgl: Update to v7.1.0 (diff) | |
download | rtems-littlevgl-2d41a623b66995151897509fcf374a0eb3b1b001.tar.bz2 |
Allow to pass custom lv_conf.h and lv_drv_conf.h.
-rw-r--r-- | default_lv_conf.h (renamed from lv_conf.h) | 0 | ||||
-rw-r--r-- | default_lv_drv_conf.h (renamed from lv_drv_conf.h) | 0 | ||||
-rw-r--r-- | lvgl.py | 19 | ||||
-rw-r--r-- | wscript | 12 |
4 files changed, 28 insertions, 3 deletions
diff --git a/lv_conf.h b/default_lv_conf.h index 9299fdc..9299fdc 100644 --- a/lv_conf.h +++ b/default_lv_conf.h diff --git a/lv_drv_conf.h b/default_lv_drv_conf.h index e8d2c40..e8d2c40 100644 --- a/lv_drv_conf.h +++ b/default_lv_drv_conf.h @@ -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]) @@ -49,9 +49,21 @@ def options(opt): dest = "drivers", help = "Build without lv_drivers." + "Useful for building without libbsd.") + opt.add_option("--lv-conf", + default = "default_lv_conf.h", + dest = "lv_conf", + help = "Use a custom lv_conf.h instead of the default one.") + opt.add_option("--lv-drv-conf", + default = "default_lv_drv_conf.h", + dest = "lv_drv_conf", + help = "Use a custom lv_drv_conf.h instead of the default one.") def configure(conf): conf.env.DRIVERS = conf.options.drivers + with open(conf.options.lv_conf, "rb") as lv_conf: + conf.env.LV_CONF = lv_conf.read() + with open(conf.options.lv_drv_conf, "rb") as lv_drv_conf: + conf.env.LV_DRV_CONF = lv_drv_conf.read() rtems.configure(conf) def build(bld): |