Commit graph

14 commits

Author SHA1 Message Date
xuxin19
cfe78ad74e cmake(enhance):enhance NuttX cmake target dependencies and link_library modules
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>
2024-11-22 15:16:07 -03:00
xuxin19
3ae822c098 cmake:remove no need target_link_library in static target
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>
2024-11-14 01:26:38 +08:00
xuxin19
4f895b3300 cmake(enhance):add NuttX CMake extensions module
Wrapped CMake native method is nuttx_cmake module
It can be quickly called in the build system

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-12 15:30:21 -03:00
anjiahao
e9e01506d3 dlcn:need select MODULES when compile
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 19:56:33 +08:00
xuxin19
1d3dd328dd modify BUILD_LOADABLE to MODULES which backwards-compatible Kernel
maintains the same semantics as Kernel’s module build
and compatible with Kconfiglib implementation.

The problem of kconfiglib not being able to use tri-states is this:
linux is here torvalds/linux@6dd85ff
The module option is extracted from one of the triate three states into a MODULE keyword.
Kconfiglib supports the default implementation of module to be MODULE for compatibility with the linux kernel, and triate degenerates into bool two states
Refer to this code: 061e71f7d7/kconfiglib.py (L4274-L4284)

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-19 08:32:03 +08:00
Alin Jerpelea
41537fe90f cmake: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-09-10 11:34:40 +08:00
xuxin19
b1b66ce491 cmake:add unified timing control phase apps_context for apps build
solve the interdependency problem of cross-target dependency generation.
like Makefile base, a PHONY context target is used as a dependency for timing order.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-21 01:53:09 +08:00
xuxin19
b325ae6391 cmake: add_application supports only registration but not compilation
for sources that have implemented multiple prog_main,
there is a situation where you don't need to add source files but need to register.
the add_application method is enhanced so that it can be registered without entering SRCS.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-08-14 16:05:27 +02:00
xuxin19
4b11d37cf7 cmake-bugfix:add santity check for target depends and change
inter_library header inheritance level

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
xuxin19
6960f1b967 cmake:change add_dep to nuttx_add_dep for nuttx_add_application
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
raiden00pl
5c9c518f7f cmake: format docstrings 2023-07-27 02:32:49 -07:00
raiden00pl
5769952471 cmake: add support for compile definitions for apps
With this we can pass build options to compiled app which is useful for integrating external projects
2023-07-26 02:52:58 -07:00
raiden00pl
db65b6b0e6 cmake: allow nuttx_add_application to inherit includes from dependent target 2023-07-13 23:49:02 +03:00
chao an
6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00