mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Revert "Improvements to SITL to make paths more flexible. (#5181)"
This reverts commit 699b6a2cb3.
This commit is contained in:
@@ -95,9 +95,9 @@ function(px4_nuttx_add_firmware)
|
||||
|
||||
add_custom_command(OUTPUT ${OUT}
|
||||
COMMAND ${OBJCOPY} -O binary ${EXE} ${EXE}.bin
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py
|
||||
--prototype ${PX4_SOURCE_DIR}/Images/${BOARD}.prototype
|
||||
--git_identity ${PX4_SOURCE_DIR}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_mkfw.py
|
||||
--prototype ${CMAKE_SOURCE_DIR}/Images/${BOARD}.prototype
|
||||
--git_identity ${CMAKE_SOURCE_DIR}
|
||||
${extra_args}
|
||||
--image ${EXE}.bin > ${OUT}
|
||||
DEPENDS ${EXE}
|
||||
@@ -148,7 +148,7 @@ function(px4_nuttx_generate_builtin_commands)
|
||||
math(EXPR command_count "${command_count}+1")
|
||||
endif()
|
||||
endforeach()
|
||||
configure_file(${PX4_SOURCE_DIR}/cmake/nuttx/builtin_commands.c.in
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/nuttx/builtin_commands.c.in
|
||||
${OUT})
|
||||
endfunction()
|
||||
|
||||
@@ -183,17 +183,17 @@ function(px4_nuttx_add_export)
|
||||
REQUIRED OUT CONFIG THREADS
|
||||
ARGN ${ARGN})
|
||||
|
||||
set(nuttx_src ${PX4_BINARY_DIR}/${CONFIG}/NuttX)
|
||||
set(nuttx_src ${CMAKE_BINARY_DIR}/${CONFIG}/NuttX)
|
||||
|
||||
# patch
|
||||
add_custom_target(__nuttx_patch_${CONFIG})
|
||||
file(GLOB nuttx_patches RELATIVE ${PX4_SOURCE_DIR}
|
||||
${PX4_SOURCE_DIR}/nuttx-patches/*.patch)
|
||||
file(GLOB nuttx_patches RELATIVE ${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/nuttx-patches/*.patch)
|
||||
foreach(patch ${nuttx_patches})
|
||||
string(REPLACE "/" "_" patch_name "${patch}-${CONFIG}")
|
||||
message(STATUS "nuttx-patch: ${patch}")
|
||||
add_custom_command(OUTPUT nuttx_patch_${patch_name}.stamp
|
||||
COMMAND ${PATCH} -p0 -N < ${PX4_SOURCE_DIR}/${patch}
|
||||
COMMAND ${PATCH} -p0 -N < ${CMAKE_SOURCE_DIR}/${patch}
|
||||
COMMAND ${TOUCH} nuttx_patch_${patch_name}.stamp
|
||||
DEPENDS ${DEPENDS}
|
||||
)
|
||||
@@ -204,7 +204,7 @@ function(px4_nuttx_add_export)
|
||||
|
||||
# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
|
||||
# note: CONFIG will be BOARD in the future evaluation of ${hw_stack_check_${CONFIG}
|
||||
file(STRINGS "${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/nsh/defconfig"
|
||||
file(STRINGS "${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/nsh/defconfig"
|
||||
hw_stack_check_${CONFIG}
|
||||
REGEX "CONFIG_ARMV7M_STACKCHECK=y"
|
||||
)
|
||||
@@ -213,29 +213,29 @@ function(px4_nuttx_add_export)
|
||||
endif()
|
||||
|
||||
# copy and export
|
||||
file(RELATIVE_PATH nuttx_cp_src ${PX4_BINARY_DIR} ${PX4_SOURCE_DIR}/NuttX)
|
||||
file(GLOB_RECURSE config_files ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
||||
add_custom_command(OUTPUT ${PX4_BINARY_DIR}/${CONFIG}.export
|
||||
file(RELATIVE_PATH nuttx_cp_src ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/NuttX)
|
||||
file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||
COMMAND ${MKDIR} -p ${nuttx_src}
|
||||
COMMAND rsync -a --delete --exclude=.git ${nuttx_cp_src}/ ${CONFIG}/NuttX/
|
||||
#COMMAND ${ECHO} Configuring NuttX for ${CONFIG}
|
||||
COMMAND ${MAKE} --no-print-directory -C${nuttx_src}/nuttx -r --quiet distclean
|
||||
COMMAND ${CP} -r ${PX4_SOURCE_DIR}/nuttx-configs/PX4_Warnings.mk ${nuttx_src}/nuttx/
|
||||
COMMAND ${CP} -r ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_src}/nuttx/configs
|
||||
COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/PX4_Warnings.mk ${nuttx_src}/nuttx/
|
||||
COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_src}/nuttx/configs
|
||||
COMMAND cd ${nuttx_src}/nuttx/tools && ./configure.sh ${CONFIG}/nsh && cd ..
|
||||
#COMMAND ${ECHO} Exporting NuttX for ${CONFIG}
|
||||
COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > nuttx_build.log
|
||||
COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${PX4_BINARY_DIR}/${CONFIG}.export
|
||||
COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${CMAKE_BINARY_DIR}/${CONFIG}.export
|
||||
DEPENDS ${config_files} ${DEPENDS}
|
||||
WORKING_DIRECTORY ${PX4_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT "Building NuttX for ${CONFIG}")
|
||||
|
||||
# extract
|
||||
add_custom_command(OUTPUT nuttx_export_${CONFIG}.stamp
|
||||
COMMAND ${RM} -rf ${nuttx_src}/nuttx-export
|
||||
COMMAND ${UNZIP} -q ${PX4_BINARY_DIR}/${CONFIG}.export -d ${nuttx_src}
|
||||
COMMAND ${UNZIP} -q ${CMAKE_BINARY_DIR}/${CONFIG}.export -d ${nuttx_src}
|
||||
COMMAND ${TOUCH} nuttx_export_${CONFIG}.stamp
|
||||
DEPENDS ${DEPENDS} ${PX4_BINARY_DIR}/${CONFIG}.export)
|
||||
DEPENDS ${DEPENDS} ${CMAKE_BINARY_DIR}/${CONFIG}.export)
|
||||
|
||||
add_custom_target(${OUT}
|
||||
DEPENDS nuttx_export_${CONFIG}.stamp)
|
||||
@@ -308,16 +308,16 @@ function(px4_nuttx_add_romfs)
|
||||
REQUIRED OUT ROOT
|
||||
ARGN ${ARGN})
|
||||
|
||||
set(romfs_temp_dir ${PX4_BINARY_DIR}/tmp/${ROOT})
|
||||
set(romfs_src_dir ${PX4_SOURCE_DIR}/${ROOT})
|
||||
set(romfs_autostart ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py)
|
||||
set(romfs_pruner ${PX4_SOURCE_DIR}/Tools/px_romfs_pruner.py)
|
||||
set(bin_to_obj ${PX4_SOURCE_DIR}/cmake/nuttx/bin_to_obj.py)
|
||||
set(romfs_temp_dir ${CMAKE_BINARY_DIR}/tmp/${ROOT})
|
||||
set(romfs_src_dir ${CMAKE_SOURCE_DIR}/${ROOT})
|
||||
set(romfs_autostart ${CMAKE_SOURCE_DIR}/Tools/px_process_airframes.py)
|
||||
set(romfs_pruner ${CMAKE_SOURCE_DIR}/Tools/px_romfs_pruner.py)
|
||||
set(bin_to_obj ${CMAKE_SOURCE_DIR}/cmake/nuttx/bin_to_obj.py)
|
||||
set(extras_dir ${CMAKE_CURRENT_BINARY_DIR}/extras)
|
||||
|
||||
file(GLOB_RECURSE romfs_src_files ${romfs_src_dir} ${romfs_src_dir}/*)
|
||||
|
||||
set(cmake_test ${PX4_SOURCE_DIR}/cmake/test/cmake_tester.py)
|
||||
set(cmake_test ${CMAKE_SOURCE_DIR}/cmake/test/cmake_tester.py)
|
||||
|
||||
|
||||
set(extras)
|
||||
@@ -346,7 +346,7 @@ function(px4_nuttx_add_romfs)
|
||||
#COMMAND cmake -E remove_directory ${romfs_temp_dir}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${bin_to_obj}
|
||||
--ld ${LD} --c_flags ${CMAKE_C_FLAGS}
|
||||
--include_path "${PX4_SOURCE_DIR}/src/include"
|
||||
--include_path "${CMAKE_SOURCE_DIR}/src/include"
|
||||
--c_compiler ${CMAKE_C_COMPILER}
|
||||
--nm ${NM} --objcopy ${OBJCOPY}
|
||||
--obj romfs.o
|
||||
@@ -414,7 +414,7 @@ function(px4_os_add_flags)
|
||||
LINK_DIRS ${LINK_DIRS}
|
||||
DEFINITIONS ${DEFINITIONS})
|
||||
|
||||
set(nuttx_export_dir ${PX4_BINARY_DIR}/${BOARD}/NuttX/nuttx-export)
|
||||
set(nuttx_export_dir ${CMAKE_BINARY_DIR}/${BOARD}/NuttX/nuttx-export)
|
||||
set(added_include_dirs
|
||||
${nuttx_export_dir}/include
|
||||
${nuttx_export_dir}/include/cxx
|
||||
|
||||
Reference in New Issue
Block a user