Swatantra-66 opened a new pull request, #3920:
URL: https://github.com/apache/nuttx-apps/pull/3920
## Summary
Addresses apache/nuttx#19549 by closing the CMake build-system parity gap in
`apps/audioutils`
1. **`audioutils/morsey`:**
Adds `CMakeLists.txt` using CMake `FetchContent` to download the upstream
`v1.0.1` release tarball.
Implements automated SHA-256 integrity verification for `morsey.c` and
`morsey.h` matching `Makefile`.
Exports the public header via symlink to
`${NUTTX_APPS_BINDIR}/include/audioutils/morsey.h`.
Compiles `morsey.c` and registers private include paths with the `apps`
library target.
2. **`audioutils/rtttl-c`:**
Adds `CMakeLists.txt` using CMake `FetchContent` to shallow clone tag
`v0.1.0`.
Implements automated SHA-256 integrity verification for `rtttl.c` and
`rtttl.h` matching `Makefile`.
Exports the public header via symlink to
`${NUTTX_APPS_BINDIR}/include/audioutils/rtttl.h`.
Compiles `rtttl.c` and registers private include paths with the `apps`
library target.
3. **Robustness & Edge-Case Safety (both modules):**
**Preapps Safety:** Conditioned on `if(CONFIG_* AND TARGET apps)` to
prevent premature evaluation during early Kconfig generation.
**Offline Build Overrides:** Honors
`FETCHCONTENT_SOURCE_DIR_MORSEY_FETCH` and
`FETCHCONTENT_SOURCE_DIR_RTTTL_C_FETCH` without attempting network access.
**Local Edit Preservation:** Rejects missing/incomplete checkouts with a
fatal error if local files exist, refusing to delete developer modifications or
Make checkouts.
**Subbuild Reset:** Wipes sub-build state under
`${FETCHCONTENT_BASE_DIR}` to ensure recovery when a fresh download is needed.
**Symlink Refresh:** Unconditionally invokes `nuttx_create_symlink` to
refresh exported header links whenever the active source directory changes.
## Impact
**New feature added:** Yes, CMake build support for `audioutils/morsey` and
`audioutils/rtttl-c`.
**Existing behavior changed:** No, existing Make builds remain 100%
untouched.
**Build process:** Enables building both modules when configuring with CMake
(`-DCONFIG_AUDIOUTILS_MORSEY=y` and `-DCONFIG_AUDIOUTILS_RTTTL_C=y`).
**Compatibility:** Fully compliant with `cmake-format` (0 warnings/errors).
## Testing
**Host:** Ubuntu 24.04 (WSL2 / Windows 11 x86_64), GCC 15.2.0, CMake 4.2.3,
Ninja 1.13.2
**Target:** `sim:nsh` (`-DCONFIG_AUDIOUTILS_MORSEY=y
-DCONFIG_AUDIOUTILS_RTTTL_C=y`)
### Build Logs:
```text
-- Populating morsey_fetch
[1/9] Performing download step (download, verify and extract) for
'morsey_fetch-populate'
-- extracting... done
[9/9] Completed 'morsey_fetch-populate'
-- Populating rtttl_c_fetch
[1/9] Performing download step (git clone) for 'rtttl_c_fetch-populate'
Cloning into 'rtttl-c'...
HEAD is now at a093e61 Release under Apache-2.0, too
[9/9] Completed 'rtttl_c_fetch-populate'
-- Build files have been written to: .../build_audiotest
ninja: Entering directory `build_audiotest'
[3/35] Building C object
apps/CMakeFiles/apps.dir/audioutils/morsey/morsey/morsey.c.o
[8/35] Building C object
apps/CMakeFiles/apps.dir/audioutils/rtttl-c/rtttl-c/rtttl.c.o
[35/35] Linking C static library apps/libapps.a
```
### Style & Format Verification:
```text
cmake-format --check apps/audioutils/morsey/CMakeLists.txt
cmake-format --check apps/audioutils/rtttl-c/CMakeLists.txt
100% CMAKE-FORMAT COMPLIANT
```
--
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]