cmake(bugfix):rename host tools binary dir to host_bin

we will use CMAKE_BINARY_DIR/bin for apps elf
so we need to change host tools to bin_host

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19
2025-03-17 20:23:09 +08:00
committed by GUIDINGLI
parent b7582b8da1
commit 70bddf61c3
7 changed files with 30 additions and 10 deletions
+5
View File
@@ -28,6 +28,11 @@ define_property(
BRIEF_DOCS "NuttX application libs"
FULL_DOCS "List of all NuttX application libraries")
# Create a directory for the application binaries
if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()
# ~~~
# nuttx_add_application
#
+2 -1
View File
@@ -235,7 +235,8 @@ function(nuttx_add_cromfs)
copy_directory ${PATH} cromfs_${NAME} \; fi
COMMAND if \[ \"${FILES}\" != \"\" \]; then ${CMAKE_COMMAND} -E copy
${FILES} cromfs_${NAME} \; fi
COMMAND ${CMAKE_BINARY_DIR}/bin/gencromfs cromfs_${NAME} cromfs_${NAME}.c
COMMAND ${CMAKE_BINARY_DIR}/bin_host/gencromfs cromfs_${NAME}
cromfs_${NAME}.c
DEPENDS ${DEPENDS})
add_library(cromfs_${NAME} OBJECT cromfs_${NAME}.c)
+19
View File
@@ -321,3 +321,22 @@ add_custom_target(
${CMAKE_COMMAND} -E echo
"'$<TARGET_PROPERTY:nuttx_target_interface,ALL_TARGETS>'" >> target_dump
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# Generate host tools CMake binary directory
execute_process(COMMAND ${CMAKE_COMMAND} -B ${CMAKE_BINARY_DIR}/bin_host -S
${CMAKE_SOURCE_DIR}/tools)
# Function: nuttx_build_host_target
#
# generate build common tools host target
#
# Usage: nuttx_build_host_target(mkdeps)
function(nuttx_build_host_target target)
if(TARGET ${target})
return()
endif()
add_custom_target(
${target}
COMMAND cmake --build ${CMAKE_BINARY_DIR}/bin_host --target ${target}
SOURCES ${ARGN})
endfunction()
+1 -6
View File
@@ -25,12 +25,7 @@ list(TRANSFORM SYSCALLS REPLACE "^\"([^,]+)\",.+" "\\1")
list(TRANSFORM SYSCALLS APPEND ".c")
# generate the host tool
add_custom_target(
mksyscall
COMMAND cmake -B ${CMAKE_BINARY_DIR}/bin -S ${CMAKE_SOURCE_DIR}/tools && cmake
--build ${CMAKE_BINARY_DIR}/bin --target mksyscall
SOURCES ${CMAKE_SOURCE_DIR}/tools/mksyscall.c)
nuttx_build_host_target(mksyscall ${CMAKE_SOURCE_DIR}/tools/mksyscall.c)
if(CONFIG_LIB_SYSCALL)
add_subdirectory(proxies)
+1 -1
View File
@@ -26,7 +26,7 @@ list(TRANSFORM SYSCALLS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/PROXY_")
# generate files
add_custom_command(
OUTPUT ${SYSCALLS}
COMMAND ${CMAKE_BINARY_DIR}/bin/mksyscall -p
COMMAND ${CMAKE_BINARY_DIR}/bin_host/mksyscall -p
${CMAKE_CURRENT_LIST_DIR}/../syscall.csv
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS mksyscall)
+1 -1
View File
@@ -26,7 +26,7 @@ list(TRANSFORM SYSCALLS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/STUB_")
# generate files
add_custom_command(
OUTPUT ${SYSCALLS}
COMMAND ${CMAKE_BINARY_DIR}/bin/mksyscall -s
COMMAND ${CMAKE_BINARY_DIR}/bin_host/mksyscall -s
${CMAKE_CURRENT_LIST_DIR}/../syscall.csv
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS mksyscall)
+1 -1
View File
@@ -26,7 +26,7 @@ list(TRANSFORM SYSCALLS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/WRAP_")
# generate files
add_custom_command(
OUTPUT ${SYSCALLS}
COMMAND ${CMAKE_BINARY_DIR}/bin/mksyscall -w
COMMAND ${CMAKE_BINARY_DIR}/bin_host/mksyscall -w
${CMAKE_CURRENT_LIST_DIR}/../syscall.csv
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS mksyscall)