Refactor the logic for managing the .config file to ensure it aligns with Make behavior. Introduce a mechanism to set CONFIG_BASE_DEFCONFIG correctly and streamline the comparison process between .config and .config.orig, improving accuracy in detecting changes.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Refactor the process of comparing .config and .config.orig files by stripping CONFIG_BASE_DEFCONFIG lines to prevent false -dirty flags. Update .config to ensure it matches the expected Make behavior by writing the correct BASE_DEFCONFIG value.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
CMake uses the `system_name` parameter by default to determine the .obj file extension.
On the Nuttx platform, our `system_name` is `bare matel`,
while CMake only uses `.o` on Linux/Unix systems otherwise, it uses `.obj`.
Therefore, we will change it to `.o` by default.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
cc1: note: unrecognized command-line option '-Wno-cpp -Werror' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-cpp -Werror' may have been intended to silence earlier diagnostics
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Instead, use direct return, because in non-build targets,
such as savedefconfig, menuconfig, this check is unnecessary
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
separate three elf link modes:
kernel elf: kernel build link all user libs and startup obj
loadable elf: `m` build dont link user libs minimize size but link
startup obj
dynlib elf:do not link user libs and startup obj
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
1.add application link dependencies for all elf
2.add a global custom target to hold proptry in the toolchain file
3.add startup obj target
4.fix cpp lds error with kernel mod link elf lds
usage:
./build.sh qemu-armv7a:knsh --cmake
elf install in ${CMAKE_BINARY_DIR}/bin
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
1. enhanced process_config.py script: supports both preprocess and postprocess modes
2. in preprocess mode: handles include formats and recursively records the include config tree structure to prepare for postprocess
3. In postprocess mode: compares the original file with menuconfig to identify non-#include items that should be written back
4. olddefconfig stores the original compressed include defconfig file at the very beginning
5. savedefconfig saves both the original file and the written back include defconfig
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
the -fmacro-prefix-map compile option is gcc/clang/armclang specific
compile option, and greenhills do not recognize this compile option, if
we add this option is CMakeLists.txt, the following warning will be
reported when each file is being compiled:
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/apps=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/boards/mann/dcu/fc4150f1m-labm_a1=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/chips/fc4150=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/apps=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/boards/mann/dcu/fc4150f1m-labm_a1=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/chips/fc4150=" passed to linker
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Enhance the nuttx_generate_kconfig() implementation to ensure that
both subdirectories and external directories containing a CMakeLists.txt
or a Kconfig file are properly included during Kconfig generation.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Currently, nuttx_generate_kconfig() can only parse subdirectories
under apps/. This patch extends its capability to also parse
external directories referenced from the apps tree.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Currently, nuttx_generate_kconfig() allows a subdirectory to have
either a handwritten sub-Kconfig or a generated menu Kconfig, but
not both.
This patch enables support for having both a sub-Kconfig and a
generated menu Kconfig within the same subdirectory.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Introduce support in CMake to ignore specific directories
added by `nuttx_add_subdirectory()`. This provides more
flexibility for build configuration and allows excluding
unwanted or optional components.
* Improves modularity of project configuration.
Signed-off-by: trns1997 <trns1997@gmail.com>
- CMake added board Raspberry Pi Pico
- Added the entry:
CMake,raspberrypi-pico:bmp280
to the file arm-06.dat.
- Moved the search for the Python 3 interpreter to the
root CMakefile to avoid unnecessary repetition.
Signed-off-by: simbit18 <simbit18@gmail.com>
Provide better hex and srec generation for tasking compiler, without relying
on freeware tricore-elf-objcopy.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add:
cmake/nuttx_process_config.cmake
tools/process_config.py
Update nuttx/CMakeLists.txt to call process_config defined ini
nuttx_process_config.cmake to process defconfig before actually using it
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.
CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF
Signed-off-by: chao an <anchao.archer@bytedance.com>
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: ../../boards/arm/stm32/nucleo-l152re/configs/nsh/defconfig
no changes added to commit (use "git add" and/or "git commit -a")
align them with the usage habits of makefile
cmake:
cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja -DEXTRAFLAGS="-DCONFIG_AAA=1 -DCONFIG_BBB=1 -Werror"
makefile:
make -j12 EXTRAFLAGS="-DCONFIG_AAA=1 -DCONFIG_BBB=1 -Werror"
Signed-off-by: chao an <anchao.archer@bytedance.com>
add support of set custom command options to config.h
Use the -D parameter to pass the config to header file.
NOTE which must begin with the CONFIG_ prefix.
eg:
cmake -DCONFIG_AAA=1 -DCONFIG_BBB=1 -B build -DBOARD_CONFIG=sim/nsh -GNinja
Signed-off-by: chao an <anchao.archer@bytedance.com>
The fake audio driver aims to easily simulate the functions of audio driver through reading and writing files.
With it, you can conveniently customize and define various capture or playback audio drivers for debugging or automated testing.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
1.make the generation sequence of etc romfs no longer bound to the board
2.RCRAWS RCSRCS can be added from any directory
3.enable dynamic files, files generated during the compilation process,
and ensure the correct time order
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Enhance CMake's add_dependencies for Nuttx so that
different targets can call dependencies without errors when they are not traversed.
In addition, since we do not call link_library directly,
we increment nuttx_link_library to inherit the PUBLIC property
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
the ${MENUCONFIG} file in the output directory is enough,
as invoking nuttx_generate_kconfig() will generate this
file in the output directory.
Since we are collecting these files recursively,
the nuttx_generate_kconfig() function of the parent directory
will be called after all the subdirectories' nuttx_generate_kconfig()
functions have been invoked.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
the link_library of the static target will cause PRIVATE to be inherited to nuttx,
resulting in duplicate linking and definition problems.
because all target static libraries will eventually be linked, there is no need to specify it explicitly.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>