Repository navigation
audioutils: Add CMake build support for morsey and rtttl-c - #3920
Conversation
Closes the CMake build-system parity gap in apps/audioutils: - audioutils/morsey: Adds CMakeLists.txt with FetchContent tarball download, public header symlinking, and library integration into apps. - audioutils/rtttl-c: Adds CMakeLists.txt with FetchContent shallow clone, public header symlinking, and library integration into apps. - Follows standard NuttX FetchContent conventions matching other submodules, with preapps configuration safety and public header symlink generation under include/audioutils. Signed-off-by: Swatantra Yadav <maverickswatantra@gmail.com>
2fc6f77 to
b171095
Compare
|
Removed the SHA checks and streamlined both CMakeLists.txt to follow the standard NuttX FetchContent pattern matching other submodules |
|
@simbit18 what if we add a rule on CI to automatically detect with a Makefile is created/modified but there is no modification on CMakefile? This way we enforce them to keep in sync and we avoid starting the CI for some PR that is not right. It will require a commit to approval when this Make/CMake mismatch happen, like when a new user submit a PR for the first time. There is only a drawback where someone could be fixing a real issue that exists only on a specific Makefile and it is already fine on CMake, but this is a rare case. And the human could approve and let the CI run. |
|
@acassis Enforcing this in the fast |
Nice, do you want to implement too? |
|
Yes Fast-fail check in CI - Run early in @acassis, would you prefer this integrated as a new option in |
@Swatantra-66 I think only a check in checkpatch.sh should be enough |
|
@acassis as discussed , I have opened PR apache/nuttx#21012 |
Summary
Addresses apache/nuttx#19549 by closing the CMake build-system parity gap in
apps/audioutilsaudioutils/morsey:Adds
CMakeLists.txtusing CMakeFetchContentto download the upstreamv1.0.1release tarball.Implements automated SHA-256 integrity verification for
morsey.candmorsey.hmatchingMakefile.Exports the public header via symlink to
${NUTTX_APPS_BINDIR}/include/audioutils/morsey.h.Compiles
morsey.cand registers private include paths with theappslibrary target.audioutils/rtttl-c:Adds
CMakeLists.txtusing CMakeFetchContentto shallow clone tagv0.1.0.Implements automated SHA-256 integrity verification for
rtttl.candrtttl.hmatchingMakefile.Exports the public header via symlink to
${NUTTX_APPS_BINDIR}/include/audioutils/rtttl.h.Compiles
rtttl.cand registers private include paths with theappslibrary target.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_FETCHandFETCHCONTENT_SOURCE_DIR_RTTTL_C_FETCHwithout 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_symlinkto refresh exported header links whenever the active source directory changes.Impact
New feature added: Yes, CMake build support for
audioutils/morseyandaudioutils/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=yand-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:
Style & Format Verification: