nuttx/tools
Alan Carvalho de Assis 87260499e1
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR)
This change fixes NuttX’s CMake support when NuttX is embedded
in another project via add_subdirectory(). CMake’s CMAKE_SOURCE_DIR
and CMAKE_BINARY_DIR refer to the outermost project, causing NuttX
to access its .config, generated files, host tools, and build artifacts
in the parent project’s directories. The fix introduces NUTTX_DIR and
NUTTX_BINARY_DIR, based on CMAKE_CURRENT_SOURCE_DIR and
CMAKE_CURRENT_BINARY_DIR, and consistently uses them for NuttX
self-references while preserving existing standalone builds. It fixes
the Kconfig initialization failure reported in #19697 and allows an
embedded sim:nsh build to configure, build, and boot successfully.
The change affects only the CMake build system (not Make or Kconfig
defaults), requires the corresponding nuttx-apps change, and does not
extend add_subdirectory() support to cross-compiled non-sim boards due
to CMake’s toolchain-file limitation.

Fixes #19697.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
2026-08-09 11:13:08 -03:00
..
ameba
bcm2711
bl602
ci
codeowners
cxd56
esp32
esp32c3
esp32s2
esp32s3
espressif cmake: Use NUTTX(_DIR/_BIN_DIR) instead CMAKE(_SRC_DIR/_BIN_DIR) 2026-08-09 11:13:08 -03:00
imx9
licensing
lwl
mpfs
nix
nxflat
pic32
pynuttx
rp23xx
rp2040
simwifi
zds
.gitignore
aarch64-unknown-nuttx-macho.json
aarch64-unknown-nuttx.json
abi_check.py
b16.c
bdf-converter.c
board_romfs_mkpasswd.sh
btdecode.sh
build-globals.sh
callstack.py
cfgdefine.c
cfgdefine.h
cfgparser.c
cfgparser.h
check_passwd_keys.sh
checkkconfig.py
checkpatch.sh
checkrelease.sh
CMakeLists.txt
cmpconfig.c
cnvwindeps.c
Config.mk
configure.bat
configure.c
configure.sh
configure_completion.bash
convert-comments.c
copydir.bat
copydir.sh
coredump.py
csvparser.c
csvparser.h
D.defs
define.bat
define.sh
detab.c
Directories.mk
discover.py
doreleasenotes.py
Export.mk
find_symbol_callers.sh
flash_writer.py
FlatLibs.mk
gcov.py
gdbserver.py
gen_passwd_keys.sh
gencromfs.c
host_info_dump.py
host_info_parse.py
i486-unknown-nuttx.json
ide_exporter.py
incdir.bat
incdir.c
incdir.sh
indent.sh
initialconfig.c
jlink-nuttx.c
kasan_global.py
kconfig.bat
kconfig2html.c
KernelLibs.mk
LibTargets.mk
link.bat
link.sh
lowhex.c
macar-qcs.sh
Make.defs
Makefile.host
merge_config.py
mkallsyms.py
mkallsyms.sh
mkconfig.c
mkconfigvars.sh
mkctags.sh
mkdeps.c
mkexport.sh
mkfsdata.pl
mkfsdata.py
mknulldeps.sh
mkpasswd.c
mkromfsimg.sh
mksymtab.c
mksyscall.c
mkversion.c
mkwindeps.sh
netusb.sh
noteinfo.c
nxstyle.c
nxstyle_sweep.sh
nxtagspkgsfetch.sh
parsecallstack.py
parsememdump.py
parsetrace.py
passwd_keys.mk
pre-commit
process_config.py
process_config.sh
promptpasswd.sh
ProtectedLibs.mk
refresh.sh
rmcr.c
Rust.defs
sethost.sh
showsize.sh
simbridge.sh
simhostroute.sh
simlaunch.sh
size_report.py
splashscreen_converter.py
stackusage.py
stm32_pinmap_tool.py
Swift.defs
testbuild.ps1
testbuild.sh
toolchain.cmake.export
uncrustify.cfg
Unix.mk
unlink.bat
unlink.sh
update_romfs_password.sh
version.sh
Win.mk
x86_64-unknown-nuttx-macho.json
x86_64-unknown-nuttx.json
xmlrpc_test.py
Zig.defs
zipme.sh