apache / mynewt-newt

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
117 stars 95 forks source link

syscfg: Write defs for packages included in build #486

Closed andrzej-kaczmarek closed 2 years ago

andrzej-kaczmarek commented 2 years ago

This adds symbols in syscfg.h for each package included in build. The symbol name has "MYNEWTPKG" prefix followed with sanitized package's full name, i.e. repo designator has "@" stripped and is separated with "_" from package name, then all illegal characters in resulting name are replaced with "".

andrzej-kaczmarek commented 2 years ago

example:

/*** Included packages */
#define MYNEWT_PKG_apache_mynewt_core__util_rwlock 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble_controller 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble_transport_common_hci_h4 1
#define MYNEWT_PKG_apache_mynewt_nimble__porting_npl_mynewt 1
#define MYNEWT_PKG_apache_mynewt_core__sys_log 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble_transport 1
#define MYNEWT_PKG_apache_mynewt_core__util_mem 1
#define MYNEWT_PKG_apache_mynewt_core__hw_drivers_uart_uart_hal 1
#define MYNEWT_PKG_apache_mynewt_core__sys_console_stub 1
#define MYNEWT_PKG_apache_mynewt_core__kernel_os 1
#define MYNEWT_PKG_apache_mynewt_core__sys_defs 1
#define MYNEWT_PKG_apache_mynewt_core__sys_log_modlog 1
#define MYNEWT_PKG_targets_blabla_nrf52840 1
#define MYNEWT_PKG_apache_mynewt_core__hw_cmsis_core 1
#define MYNEWT_PKG_apache_mynewt_core__hw_drivers_uart 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble_drivers_nrf52 1
#define MYNEWT_PKG_apache_mynewt_core__sys_log_common 1
#define MYNEWT_PKG_apache_mynewt_core__sys_sysinit 1
#define MYNEWT_PKG_targets_blabla_config 1
#define MYNEWT_PKG_apache_mynewt_core__sys_log_stub 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble_transport_uart 1
#define MYNEWT_PKG_apache_mynewt_nimble__apps_blehci 1
#define MYNEWT_PKG_apache_mynewt_core__hw_mcu_nordic_nrf52xxx 1
#define MYNEWT_PKG_apache_mynewt_core__libc_baselibc 1
#define MYNEWT_PKG_apache_mynewt_core__sys_stats_full 1
#define MYNEWT_PKG_apache_mynewt_core__sys_sysdown 1
#define MYNEWT_PKG_apache_mynewt_core__sys_flash_map 1
#define MYNEWT_PKG_apache_mynewt_core__hw_mcu_nordic 1
#define MYNEWT_PKG_apache_mynewt_nimble__nimble 1
#define MYNEWT_PKG_apache_mynewt_core__hw_bsp_nordic_pca10056 1
#define MYNEWT_PKG_apache_mynewt_core__compiler_arm_none_eabi_m4 1
#define MYNEWT_PKG_apache_mynewt_core__sys_console 1
#define MYNEWT_PKG_apache_mynewt_core__sys_sys 1
#define MYNEWT_PKG_apache_mynewt_core__hw_hal 1
kasjer commented 2 years ago

It seems that with this change while syscfg.h do have new defines newt build always rebuilds everything as if syscfg.h was different from the one in previous build

andrzej-kaczmarek commented 2 years ago

@kasjer should be fixed now