mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-26 16:28:06 +08:00
NuttX build in place
- cmake NuttX build wrapper compile in place instead of copying source tree to build directory
- slightly faster skipping necessary copying (depending on system)
- allows debugging in place
- easier to work directly in NuttX following official documentation
- simplifies overall build which should make it easier to resolve any remaining NuttX dependency issues in the build system
- the downside is switching back and forth between different builds always require rebuilding NuttX, but I think this is worth the improved developer experience
- also no longer builds px4io and bootloader in every single build, for most users these rarely change and we're wasting a lot of build time
This commit is contained in:
@@ -51,17 +51,17 @@
|
||||
function(px4_os_add_flags)
|
||||
|
||||
include_directories(BEFORE SYSTEM
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx/include
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx/include/cxx
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/include
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/include/cxx
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/include/cxx # custom new
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/${CONFIG_ARCH_FAMILY}
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/chip
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/common
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/arch/${CONFIG_ARCH}/src/${CONFIG_ARCH_FAMILY}
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/arch/${CONFIG_ARCH}/src/chip
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/arch/${CONFIG_ARCH}/src/common
|
||||
|
||||
${PX4_BINARY_DIR}/NuttX/apps/include
|
||||
${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/apps/include
|
||||
)
|
||||
|
||||
# prevent using the toolchain's std c++ library
|
||||
@@ -178,6 +178,6 @@ function(px4_os_prebuild_targets)
|
||||
|
||||
add_library(prebuild_targets INTERFACE)
|
||||
target_link_libraries(prebuild_targets INTERFACE nuttx_xx nuttx_c nuttx_fs nuttx_mm nuttx_sched m gcc)
|
||||
add_dependencies(prebuild_targets DEPENDS nuttx_build uorb_headers)
|
||||
add_dependencies(prebuild_targets DEPENDS nuttx_context uorb_headers)
|
||||
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user