Skip to content

Commit add50b3

Browse files
xuxin930xiaoxiang781216
authored andcommitted
cmake(bugfix):fix NuttX CMake Wasm build multi dirs cannot be identified
System is unknown to cmake, create: Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please post that file on discourse.cmake.org. CMake Error at CMakeLists.txt:100 (add_subdirectory): add_subdirectory given source /home/data/vela/tmp/apps/frameworks/security/ta/hello_world /home/data/vela/tmp/apps/frameworks/security/ta/" which is not an existing directory. Signed-off-by: xuxin19 <[email protected]>
1 parent 0b0a220 commit add50b3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

tools/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if(CONFIG_TOOLS_WASM_BUILD OR CONFIG_INTERPRETERS_WAMR_BUILD_MODULES_FOR_NUTTX)
5050
${CMAKE_COMMAND} -B${CMAKE_BINARY_DIR}/Wasm
5151
${CMAKE_CURRENT_SOURCE_DIR}/Wasm -DAPPDIR=${APPDIR} -DTOPDIR=${TOPDIR}
5252
-DTOPBINDIR=${CMAKE_BINARY_DIR} -DKCONFIG_FILE_PATH=${KCONFIG_FILE_PATH}
53-
-DWASI_SDK_PATH=$ENV{WASI_SDK_PATH} -DWASM_DIRS=${WASM_DIRS})
53+
-DWASI_SDK_PATH=$ENV{WASI_SDK_PATH} -DWASM_DIRS="${WASM_DIRS}")
5454

5555
add_custom_target(wasm_build COMMAND ${CMAKE_COMMAND} --build
5656
${CMAKE_BINARY_DIR}/Wasm)

tools/Wasm/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ function(nuttx_add_library)
9595

9696
endfunction()
9797

98+
separate_arguments(WASM_DIRS)
99+
98100
# ~~~
99101
# Add all the Wasm apps to the build process.
100102
foreach(WASM_APP ${WASM_DIRS})

tools/Wasm/WASI-SDK.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ function(wasm_add_library)
378378
message(FATAL_ERROR "NAME is not provided.")
379379
endif()
380380

381+
# Check if the LIB_NAME (NAME) is already declared If it is, then skip the
382+
# rest of the function
383+
if(TARGET ${LIB_NAME})
384+
message(STATUS "Target ${LIB_NAME} already declared.")
385+
return()
386+
endif()
387+
381388
# Check if the LIB_SRCS (SRCS) is provided
382389
if(NOT LIB_SRCS)
383390
message(FATAL_ERROR "SRCS is not provided.")

0 commit comments

Comments
 (0)