Skip to content

netutils/cjson: fix apps path in CMake#3439

Merged
linguini1 merged 1 commit intoapache:masterfrom
fdcavalcanti:bugfix/apps-path
Mar 27, 2026
Merged

netutils/cjson: fix apps path in CMake#3439
linguini1 merged 1 commit intoapache:masterfrom
fdcavalcanti:bugfix/apps-path

Conversation

@fdcavalcanti
Copy link
Copy Markdown
Contributor

Summary

  • netutils/cjson: fix apps path in CMake

Fix mismatch on apps directory naming when it is cloned under 'nuttx-apps' instead of 'apps'.

It replaces the hardcoded ${CMAKE_BINARY_DIR}/apps directory with ${NUTTX_APPS_BINDIR}.

Impact

Impact on user: No.

Impact on build: Yes, it automatically uses the proper nuttx-apps repository name instead of requiring a hardcoded one.

Impact on hardware: No.

Impact on documentation: No.

Impact on security: No.

Impact on compatibility: No.

Testing

Build any application that requires CJSON. In my case, I used esp32c3-devkit:sta_softap (which CMake support is under test) and it kept failing the build.

Building

  • cmake -B build -DBOARD_CONFIG=esp32c3-devkit:sta_softap -GNinja -DNXTMPDIR=on
  • cmake --build build

Results

Before changes:

[1685/1783] Building C object apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o
FAILED: apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o 
/home/fdcavalcanti/work/toolchains/riscv-none-elf-gcc/bin/riscv-none-elf-gcc -D__NuttX__ -I/home/fdcavalcanti/nuttxspace1/nuttx-apps/system/argtable3/argtable3/src -I/home/fdcavalcanti/nuttxspace1/nuttx-apps/include -I/home/fdcavalcanti/nuttxspace1/nuttx/build/nuttx-apps/include -isystem /home/fdcavalcanti/nuttxspace1/nuttx/include -isystem /home/fdcavalcanti/nuttxspace1/nuttx/build/include -Os -fno-strict-aliasing -fomit-frame-pointer -fno-common -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -Wstrict-prototypes -ffunction-sections -fdata-sections -march=rv32imc_zicsr_zifencei -mabi=ilp32 -fdiagnostics-color=always -fmacro-prefix-map=/home/fdcavalcanti/nuttxspace1/nuttx= -fmacro-prefix-map=/home/fdcavalcanti/nuttxspace1/nuttx-apps= -fmacro-prefix-map=/home/fdcavalcanti/nuttxspace1/nuttx/boards/risc-v/esp32c3/esp32c3-devkit= -fmacro-prefix-map=/home/fdcavalcanti/nuttxspace1/nuttx/arch/risc-v/src/esp32c3= @apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o.rsp -MD -MT apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o -MF apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o.d -o apps/CMakeFiles/apps.dir/wireless/wapi/src/util.c.o -c /home/fdcavalcanti/nuttxspace1/nuttx-apps/wireless/wapi/src/util.c
/home/fdcavalcanti/nuttxspace1/nuttx-apps/wireless/wapi/src/util.c:55:10: fatal error: netutils/cJSON.h: No such file or directory
   55 | #include "netutils/cJSON.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.

After changes:

[1644/1779] Building C object apps/CMakeFiles/apps.dir/netutils/dhcpd/dhcpd.c.o
/home/fdcavalcanti/nuttxspace5/nuttx-apps/netutils/dhcpd/dhcpd.c: In function 'dhcpd_allocipaddr':
/home/fdcavalcanti/nuttxspace5/nuttx-apps/netutils/dhcpd/dhcpd.c:519:4: warning: #warning "FIXME: Should check if anything responds to an ARP request or ping" [-Wcpp]
  519 | #  warning "FIXME: Should check if anything responds to an ARP request or ping"
      |    ^~~~~~~
/home/fdcavalcanti/nuttxspace5/nuttx-apps/netutils/dhcpd/dhcpd.c:520:4: warning: #warning "       to verify that there is no other user of this IP address" [-Wcpp]
  520 | #  warning "       to verify that there is no other user of this IP address"
      |    ^~~~~~~
[1779/1779] Running utility command for nuttx_post_build
-- Generate NuttX image (esptool elf2image)
esptool v5.2.0
Creating ESP32-C3 image...
Image has only RAM segments visible. ROM segments are hidden and SHA256 digest is not appended.
Merged 1 ELF section.
Successfully created ESP32-C3 image.
-- Generated: nuttx.bin

Fix mismatch on apps directory naming when it is cloned under 'nuttx-apps' instead of 'apps'.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Copy link
Copy Markdown
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @fdcavalcanti good catch! :-)

@linguini1 linguini1 merged commit f3a7282 into apache:master Mar 27, 2026
40 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.

3 participants