Skip to content

games/nxdoom: add CMake build support - #3862

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Swatantra-66:cmake/games-nxdoom
Oct 19, 2026
Merged

xiaoxiang781216 merged 1 commit into
apache:masterfrom
Swatantra-66:cmake/games-nxdoom

Conversation

@Swatantra-66

Copy link
Copy Markdown
Contributor

Summary

Addresses the CMake vs. Make build-system gap for apps/games/NXDoom identified in issue apache/nuttx#19549 ("[Analysis] CMake vs. Make Build-System Gap Analysis"):

Adds apps/games/NXDoom/CMakeLists.txt providing CMake build configuration for the NXDoom game port:

  • Declares the nxdoom application target via nuttx_add_application with configurable priority (CONFIG_GAMES_NXDOOM_PRIORITY) and stack size (CONFIG_GAMES_NXDOOM_STACKSIZE).
  • Includes common sources (i_system.c, m_argv.c, m_misc.c, z_native.c), dehacked sources, base sources, and doom core engine sources.
  • Implements conditional compilation matching Makefile:
    • CONFIG_GAMES_NXDOOM_ENDOOM: includes src/i_endoom.c and textscreen widgets.
    • CONFIG_GAMES_NXDOOM_NET: includes networking logic and textscreen widgets.
    • CONFIG_GAMES_NXDOOM_SOUND: includes audio, MIDI, and sound effect sources.
    • CONFIG_GAMES_NXDOOM_RTTTL_MUSIC: includes RTTTL music playback support.
  • Configures include paths for src, src/doom, textscreen, and pcsound.

Addresses apache/nuttx#19549

Together with #3861, this completes 100% CMake build support for all games in apps/games.

Impact

  • New Feature: Enables CMake build configuration and compilation for NXDoom.
  • 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
  • Verification: Formatted with cmake-format and verified with checkpatch.sh.
  • Target: sim:nsh (with CONFIG_GAMES_NXDOOM=y, CONFIG_ALLOW_GPL_COMPONENTS=y, CONFIG_DRIVERS_VIDEO=y, CONFIG_VIDEO_FB=y, CONFIG_CRYPTO=y, CONFIG_LIBC_LOCALE=y).

Build Log:

$ 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 (100.4s)
-- Generating done (10.9s)
-- Build files have been written to: build

$ cmake --build build --target apps_nxdoom
[1/94] Building C object apps/games/NXDoom/CMakeFiles/apps_nxdoom.dir/src/z_native.c.o
[2/94] Building C object apps/games/NXDoom/CMakeFiles/apps_nxdoom.dir/src/i_main.c.o
[3/94] Building C object apps/games/NXDoom/CMakeFiles/apps_nxdoom.dir/src/m_argv.c.o
...
[92/94] Building C object apps/games/NXDoom/CMakeFiles/apps_nxdoom.dir/src/doom/st_stuff.c.o
[93/94] Building C object apps/games/NXDoom/CMakeFiles/apps_nxdoom.dir/src/doom/wi_stuff.c.o
[94/94] Linking C static library apps/games/NXDoom/libapps_nxdoom.a
[94/94] Built target apps_nxdoom

(Note: NXDoom runtime execution requires an external DOOM IWAD game data file (e.g. doom1.wad) in /data/ and an active framebuffer display driver; verified static library compilation and symbol linking).

Closes CMake build gap for apps/games/NXDoom identified in issue apache/nuttx#19549:
- Adds apps/games/NXDoom/CMakeLists.txt matching Makefile options.
- Configures nxdoom application with priority, stacksize, and module options.
- Supports core sources, dehacked sources, base sources, and doom sources.
- Supports conditional compilation for CONFIG_GAMES_NXDOOM_ENDOOM, CONFIG_GAMES_NXDOOM_NET, CONFIG_GAMES_NXDOOM_SOUND, and CONFIG_GAMES_NXDOOM_RTTTL_MUSIC.
- Formatted with cmake-format and verified with checkpatch.sh.

Signed-off-by: Swatantra Yadav <maverickswatantra@gmail.com>
@linguini1

Copy link
Copy Markdown
Contributor

Maybe let's wait for #3860 to be merged, and then update this PR so Make and CMake are the same. Otherwise we will have a diversion.

@Swatantra-66

Copy link
Copy Markdown
Contributor Author

Sounds good, @linguini1!

I will keep an eye on #3860. As soon as it merges into master, I will rebase and update CMakeLists.txt to match your new memory options (z_zone/z_native) and configuration flags so Make and CMake stay 1:1 in sync.

@xiaoxiang781216
xiaoxiang781216 merged commit 5aa9852 into apache:master Oct 19, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants