xiaoxiang781216 commented on code in PR #2260:
URL: https://github.com/apache/nuttx-apps/pull/2260#discussion_r1460167875


##########
examples/hello_zig/Makefile:
##########
@@ -22,7 +22,7 @@ include $(APPDIR)/Make.defs
 
 # Hello, Zig! Example
 
-MAINSRC = hello_zig_main.zig
+MAINSRC = $(if $(CONFIG_BUILD_KERNEL), hello_zig.zig, hello_zig_main.zig)

Review Comment:
   Here is the key point, MAINSRC in flat build will add -Dmain=xxx_main here:
   
https://github.com/apache/nuttx-apps/pull/2260/files#diff-a095e492c7e42825cec90da21edd36464ab9c3131c2fea9ff970e49a54712af5L259
   But, this macro is removed when building as module:
   
https://github.com/apache/nuttx-apps/pull/2260/files#diff-a095e492c7e42825cec90da21edd36464ab9c3131c2fea9ff970e49a54712af5R243
   You can use the same approach as zig.



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