Junbo-Zheng opened a new pull request, #3781:
URL: https://github.com/apache/nuttx-apps/pull/3781

   ## Summary
   
   Three `if(NOT EXISTS ...)` guards referenced variables without the leading 
`$`, so CMake tested the literal strings `{LUAMOD_DIR}`, `{WAMR_MODULE_DIR}` 
and `{NUTTX_APPS_BINDIR}/dummy.c` instead of the expanded paths. Since a 
literal like that never names an existing path, the guards never 
short-circuited:
   
   - `file(MAKE_DIRECTORY ...)` in `cmake/nuttx_add_luamod.cmake` and 
`cmake/nuttx_add_wamrmod.cmake` ran on every configure (harmless, but the guard 
was dead code).
   - `file(TOUCH ${NUTTX_APPS_BINDIR}/dummy.c)` in `CMakeLists.txt` re-touched 
`dummy.c` on every reconfigure, invalidating its object and forcing a needless 
recompile each time.
   
   ## Impact
   
   - **Users**: None -- no API or runtime behavior change.
   - **Build**: Configure-time only; the guards now short-circuit as intended. 
`dummy.c` is no longer re-touched after reconfigures.
   - **Hardware**: None.
   - **Documentation**: None.
   - **Security & Compatibility**: None.
   
   ## Testing
   
   Verified with a minimal CMake pru 22.04) that `{LUAMOD_DIR}` is treated as a 
literal path that never exists, so the guard body always executeed `sim:nsh` 
with `cmake -B build -DBOARD_CONFIG=sim:nsh` against the patched apps tree 
(configure and), and confirmed a second configure run leaves the timestamp of 
`build/apps/dummy.c` unchanged, ped.


-- 
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]

Reply via email to