mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
NuttX use toolchain math.h and avoid empty drivers/Kconfig
This commit is contained in:
committed by
Lorenz Meier
parent
a8e7ddd44e
commit
99aae8b891
@@ -41,10 +41,6 @@
|
||||
|
||||
#include <px4_platform_common/log.h>
|
||||
|
||||
#if defined(__PX4_NUTTX) && !defined(CONFIG_ARCH_MATH_H)
|
||||
#error CONFIG_ARCH_MATH_H is required to use math definitions and functions
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Defines for all platforms.
|
||||
****************************************************************************/
|
||||
|
||||
@@ -144,19 +144,19 @@ add_custom_target(nuttx_config_kconfig_target
|
||||
# copy NuttX config directory
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${NUTTX_DIR}/arch/arm/include/math.h
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx-config/include/board.h
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx-config/include/nsh_romfsimg.h
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx-config/scripts/script.ld
|
||||
${PX4_BINARY_DIR}/NuttX/nuttx-config/drivers/Kconfig
|
||||
${CMAKE_CURRENT_BINARY_DIR}/nuttx_copy_config_dir.stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${NUTTX_DIR}/include/nuttx/config.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${NUTTX_CONFIG_DIR}/ ${PX4_BINARY_DIR}/NuttX/nuttx-config
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/NuttX/nuttx-config/drivers
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${PX4_BINARY_DIR}/NuttX/nuttx-config/drivers/Kconfig
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/NuttX/nuttx-config/src
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NUTTX_SRC_DIR}/math.h ${NUTTX_DIR}/arch/arm/include/math.h # copy arm math.h into NuttX source
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NUTTX_SRC_DIR}/nsh_romfsimg.h ${PX4_BINARY_DIR}/NuttX/nuttx-config/include/nsh_romfsimg.h
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/nuttx_copy_config_dir.stamp
|
||||
DEPENDS
|
||||
${NUTTX_SRC_DIR}/math.h
|
||||
${NUTTX_SRC_DIR}/nsh_romfsimg.h
|
||||
${NUTTX_CONFIG_DIR}/include/board.h
|
||||
${NUTTX_CONFIG_DIR}/scripts/script.ld
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -110,12 +110,17 @@ execute_process(
|
||||
)
|
||||
|
||||
# NuttX extra files
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NUTTX_SRC_DIR}/math.h ${NUTTX_DIR}/arch/arm/include/math.h) # copy arm math.h into NuttX source
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NUTTX_SRC_DIR}/nsh_romfsimg.h ${PX4_BINARY_DIR}/NuttX/nuttx-config/include/nsh_romfsimg.h)
|
||||
|
||||
# copy defconfig
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NUTTX_DEFCONFIG} ${NUTTX_DIR}/.config)
|
||||
|
||||
# create empty drivers/Kconfig
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/NuttX/nuttx-config/drivers
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${PX4_BINARY_DIR}/NuttX/nuttx-config/drivers/Kconfig
|
||||
)
|
||||
|
||||
# copy PX4 board config into nuttx
|
||||
file(STRINGS ${NUTTX_DEFCONFIG} config_expanded REGEX "# Automatically generated file; DO NOT EDIT.")
|
||||
if (NOT config_expanded)
|
||||
|
||||
@@ -71,6 +71,9 @@ function(px4_os_add_flags)
|
||||
add_definitions(
|
||||
-D__PX4_NUTTX
|
||||
-D__DF_NUTTX
|
||||
|
||||
-D_SYS_CDEFS_H_ # skip toolchain's <sys/cdefs.h>
|
||||
-D_SYS_REENT_H_ # skip toolchain's <sys/reent.h>
|
||||
)
|
||||
|
||||
if("${CONFIG_ARMV7M_STACKCHECK}" STREQUAL "y")
|
||||
|
||||
Reference in New Issue
Block a user