acassis commented on code in PR #3526:
URL: https://github.com/apache/nuttx-apps/pull/3526#discussion_r3462552153
##########
examples/sotest/main/CMakeLists.txt:
##########
@@ -21,27 +21,70 @@
#
##############################################################################
if(CONFIG_EXAMPLES_SOTEST)
+ set(SOTEST_SYMTAB ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c)
+ set(SOTEST_ROMFS_IMG ${CMAKE_CURRENT_BINARY_DIR}/sotest_romfs.img)
+ set(SOTEST_ROMFS_SRC ${CMAKE_CURRENT_BINARY_DIR}/sotest_romfs.c)
+ set(SOTEST_MODPRINT_ELF ${CMAKE_BINARY_DIR}/bin/modprint)
+ set(SOTEST_SHARED_ELF ${CMAKE_BINARY_DIR}/bin/sotest)
+
+ # Dynamic applications are wrapped in ELF_* helper targets when the build
uses
+ # the non-ELF-capable compiler path.
+ if(CMAKE_C_ELF_COMPILER)
+ set(SOTEST_MODPRINT_TARGET modprint)
+ set(SOTEST_SHARED_TARGET sotest)
+ else()
+ set(SOTEST_MODPRINT_TARGET ELF_modprint)
+ set(SOTEST_SHARED_TARGET ELF_sotest)
+ endif()
- # FIXME: fix all empty a after the kernel build is implemented
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c
+ OUTPUT ${SOTEST_SYMTAB}
COMMAND
- ${NUTTX_APPS_DIR}/tools/mksymtab.sh ${CMAKE_CURRENT_BINARY_DIR}/empty
- g_sot > ${CMAKE_CURRENT_BINARY_DIR}/sotest_symtab.c)
+ sh -c
Review Comment:
> Hi @acassis, yes, you're right! With CMake, it's best to avoid shell
scripts and use Python instead, since it's more portable.
@simbit18 although python is used on some scripts inside tools/ I think the
recommendation it to avoid depending on python on the building system. I think
@raiden00pl already raised this questions many time: "should we accept python
or not?" I think Greg vision was always to avoid depending on python or
external dependencies (keep it the minimal).
I think we should define (vote?) about it to get this thing well defined.
Maybe python is a "necessary evil" ?
--
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]