Swatantra-66 opened a new pull request, #3861:
URL: https://github.com/apache/nuttx-apps/pull/3861
## Summary
Add CMake build support (`CMakeLists.txt`) for the remaining simple games in
`apps/games`:
- **`snake`**: Added `apps/games/snake/CMakeLists.txt` matching `Makefile`
options (`CONFIG_GAMES_SNAKE_*`).
- **`brickmatch`**: Added `apps/games/brickmatch/CMakeLists.txt` matching
`Makefile` options (`CONFIG_GAMES_BRICKMATCH_*`).
- **`match4`**: Added `apps/games/match4/CMakeLists.txt` matching `Makefile`
options (`CONFIG_GAMES_MATCH4_*`).
All CMake files have been formatted with `cmake-format` and verified with
`checkpatch.sh`.
## Impact
- **New Feature:** Enables CMake build configuration and compilation for
`snake`, `brickmatch`, and `match4`.
- **Existing Feature:** No change to existing Make build or runtime logic.
- **Compatibility:** Fully backwards compatible.
## Testing
- **Host:** Linux x86_64 (Ubuntu / WSL2)
- **Toolchain:** GCC 15.2.0, CMake 4.2.3, Ninja 1.13.2
- **Target:** `sim:nsh` (with `CONFIG_GAMES_BRICKMATCH=y`,
`CONFIG_GAMES_SNAKE=y`, `CONFIG_GAMES_MATCH4=y`)
### Build Log:
```text
$ cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
-- Initializing NuttX
-- CMake: 4.2.3
-- Ninja: 1.13.2
-- Board: sim
-- Config: nsh
-- Appdir: /path/to/nuttx-apps
-- Configuring done (97.6s)
-- Generating done (11.6s)
-- Build files have been written to: build
$ cmake --build build --target apps_brick apps_snake apps_match
[1/5] Building C object
apps/games/snake/CMakeFiles/apps_snake.dir/snake_main.c.o
[2/5] Building C object
apps/games/match4/CMakeFiles/apps_match.dir/match4_main.c.o
[3/5] Linking C static library apps/games/snake/libapps_snake.a
[4/5] Linking C static library apps/games/match4/libapps_match.a
[5/5] Linking C static library apps/games/brickmatch/libapps_brick.a
$ cmake --build build --target nuttx
[1217/1248] Linking C static library apps/games/brickmatch/libapps_brick.a
[1237/1248] Generating nuttx.rel
[1247/1248] Linking C executable nuttx
[1248/1248] Built target nuttx
```
### Runtime Log:
```text
$ ./build/nuttx
NuttShell (NSH) NuttX-12.x
nsh> help
help usage: help [-v] [<cmd>]
. dirname free mount set umount
[ date help mv kill unset
? df hexdump pidof pkill uptime
alias dmesg losetup poweroff sleep watch
unalias echo ln quit usleep xd
basename env ls printf source wait
break exec du ps test
cat exit mkdir pwd time
cd expr mkfatfs readlink true
cp false mkfifo rm truncate
cmp fdinfo mkrd rmdir uname
Builtin Apps:
brick dumpstack nsh init gpio
dd gcov sh ostest hello
nsh> brick
ERROR: Failed to open /dev/fb0: 2
nsh> exit
```
(Note: brick exits with Failed to open /dev/fb0: 2 (ENOENT) as expected on
headless sim:nsh since no framebuffer display driver is attached, confirming
that the builtin application registers and executes successfully).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]