mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 03:03:34 +08:00
cmake nuttx build modify copied nuttx repo .git to point to actual git dir
- this fixes builds that contain a px4io and use the Makefile generator rather than Ninja
This commit is contained in:
@@ -82,6 +82,17 @@ if((NOT EXISTS ${PX4_BINARY_DIR}/NuttX/nuttx_copy.stamp) OR (NOT EXISTS ${PX4_BI
|
||||
file(RELATIVE_PATH CP_SRC ${CMAKE_SOURCE_DIR} ${NUTTX_SRC_DIR}/nuttx)
|
||||
file(RELATIVE_PATH CP_DST ${CMAKE_SOURCE_DIR} ${PX4_BINARY_DIR}/NuttX)
|
||||
execute_process(COMMAND ${NUTTX_COPY_CMD} ${NUTTX_COPY_CMD_OPTS} ${CP_SRC} ${CP_DST} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# replace NuttX .git with actual git repo location (absolute path)
|
||||
execute_process(
|
||||
COMMAND git rev-parse --absolute-git-dir
|
||||
OUTPUT_VARIABLE nuttx_git_dir
|
||||
WORKING_DIRECTORY ${NUTTX_SRC_DIR}/nuttx
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${PX4_BINARY_DIR}/NuttX/nuttx/.git)
|
||||
file(WRITE ${PX4_BINARY_DIR}/NuttX/nuttx/.git "gitdir: ${nuttx_git_dir}")
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${PX4_BINARY_DIR}/NuttX/nuttx_copy.stamp)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user