mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Set flags for building the proper DriverFramework target
The DF_TARGET cmake variable needs to be set to (linux, darwin, qurt, nuttx) The define __DF_LINUX or __DF_QURT needs to be set. The __DF_DARWIN target is untested Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -150,6 +150,16 @@ list(GET config_args 1 BOARD)
|
|||||||
list(GET config_args 2 LABEL)
|
list(GET config_args 2 LABEL)
|
||||||
set(target_name "${OS}-${BOARD}-${LABEL}")
|
set(target_name "${OS}-${BOARD}-${LABEL}")
|
||||||
|
|
||||||
|
if("${OS}" STREQUAL "posix")
|
||||||
|
if (APPLE)
|
||||||
|
set(DF_TARGET darwin)
|
||||||
|
else()
|
||||||
|
set(DF_TARGET linux)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(DF_TARGET ${OS})
|
||||||
|
endif()
|
||||||
|
|
||||||
message(STATUS "${target_name}")
|
message(STATUS "${target_name}")
|
||||||
|
|
||||||
# switch to ros CMake file if building ros
|
# switch to ros CMake file if building ros
|
||||||
@@ -327,6 +337,10 @@ endforeach()
|
|||||||
add_subdirectory(src/firmware/${OS})
|
add_subdirectory(src/firmware/${OS})
|
||||||
add_subdirectory(src/lib/DriverFramework)
|
add_subdirectory(src/lib/DriverFramework)
|
||||||
|
|
||||||
|
if("${OS}" STREQUAL "nuttx")
|
||||||
|
add_dependencies(df_driver_framework nuttx_export_${BOARD})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (config_io_board)
|
if (config_io_board)
|
||||||
add_subdirectory(src/modules/px4iofirmware)
|
add_subdirectory(src/modules/px4iofirmware)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -429,6 +429,7 @@ function(px4_os_add_flags)
|
|||||||
)
|
)
|
||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_NUTTX
|
-D__PX4_NUTTX
|
||||||
|
-D__DF_NUTTX
|
||||||
)
|
)
|
||||||
set(added_c_flags
|
set(added_c_flags
|
||||||
-nodefaultlibs
|
-nodefaultlibs
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ if(UNIX AND APPLE)
|
|||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_POSIX
|
-D__PX4_POSIX
|
||||||
-D__PX4_DARWIN
|
-D__PX4_DARWIN
|
||||||
|
-D__DF_DARWIN
|
||||||
-DCLOCK_MONOTONIC=1
|
-DCLOCK_MONOTONIC=1
|
||||||
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
|
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
|
||||||
-include ${PX4_INCLUDE_DIR}visibility.h
|
-include ${PX4_INCLUDE_DIR}visibility.h
|
||||||
@@ -185,6 +186,7 @@ else()
|
|||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_POSIX
|
-D__PX4_POSIX
|
||||||
-D__PX4_LINUX
|
-D__PX4_LINUX
|
||||||
|
-D__DF_LINUX
|
||||||
-DCLOCK_MONOTONIC=1
|
-DCLOCK_MONOTONIC=1
|
||||||
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
|
-Dnoreturn_function=__attribute__\(\(noreturn\)\)
|
||||||
-include ${PX4_INCLUDE_DIR}visibility.h
|
-include ${PX4_INCLUDE_DIR}visibility.h
|
||||||
|
|||||||
Submodule src/lib/DriverFramework updated: 45878058a7...3bbaf1a46d
Submodule src/lib/dspal updated: c8e885aac5...93b8d36619
Reference in New Issue
Block a user