mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
cmake remove circular linking and reorganize
- px4_add_module now requires MAIN - px4_add_library doesn't automatically link
This commit is contained in:
@@ -10,33 +10,31 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-prototypes")
|
||||
|
||||
get_property(module_libraries GLOBAL PROPERTY PX4_LIBRARIES)
|
||||
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
|
||||
|
||||
px4_qurt_generate_builtin_commands(
|
||||
OUT ${PX4_BINARY_DIR}/apps
|
||||
MODULE_LIST ${module_libraries})
|
||||
MODULE_LIST ${module_libraries}
|
||||
)
|
||||
|
||||
FASTRPC_STUB_GEN(px4muorb.idl)
|
||||
|
||||
# Enable build without HexagonSDK to check link dependencies
|
||||
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
|
||||
|
||||
add_definitions(-D QURT_EXE_BUILD=1)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${FASTRPC_DSP_INCLUDES}
|
||||
)
|
||||
|
||||
add_executable(px4
|
||||
${PX4_BINARY_DIR}/src/firmware/qurt/px4muorb_skel.c
|
||||
${PX4_BINARY_DIR}/apps.cpp
|
||||
)
|
||||
${PX4_BINARY_DIR}/platforms/qurt/px4muorb_skel.c
|
||||
)
|
||||
|
||||
target_link_libraries(px4
|
||||
-Wl,--start-group
|
||||
${module_libraries}
|
||||
${df_driver_libs}
|
||||
-Wl,--end-group
|
||||
)
|
||||
target_link_libraries(px4 PRIVATE ${module_libraries} ${df_driver_libs})
|
||||
else()
|
||||
# Generate the DSP lib and stubs but not the apps side executable
|
||||
# The Apps side executable is generated via the posix_eagle_xxxx target
|
||||
@@ -58,6 +56,6 @@ else()
|
||||
DEPENDS px4 px4muorb_skel
|
||||
COMMENT "uploading px4"
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -162,7 +162,7 @@ function(px4_os_add_flags)
|
||||
DEFINITIONS ${DEFINITIONS})
|
||||
|
||||
set(DSPAL_ROOT src/lib/DriverFramework/dspal)
|
||||
set(added_include_dirs
|
||||
include_directories(
|
||||
${DSPAL_ROOT}/include
|
||||
${DSPAL_ROOT}/mpu_spi/inc
|
||||
${DSPAL_ROOT}/sys
|
||||
@@ -173,7 +173,7 @@ function(px4_os_add_flags)
|
||||
platforms/qurt/include
|
||||
)
|
||||
|
||||
set(added_definitions
|
||||
add_definitions(
|
||||
-D__DF_QURT # For DriverFramework
|
||||
-D__PX4_POSIX
|
||||
-D__PX4_QURT
|
||||
@@ -195,8 +195,8 @@ function(px4_os_add_flags)
|
||||
)
|
||||
|
||||
# Clear -rdynamic flag which fails for hexagon
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||
|
||||
set(DF_TARGET "qurt" PARENT_SCOPE)
|
||||
|
||||
@@ -238,8 +238,6 @@ function(px4_os_prebuild_targets)
|
||||
REQUIRED OUT BOARD
|
||||
ARGN ${ARGN})
|
||||
|
||||
add_custom_target(${OUT} DEPENDS git_driverframework uorb_headers)
|
||||
|
||||
add_library(${OUT} INTERFACE)
|
||||
add_dependencies(${OUT} DEPENDS uorb_headers)
|
||||
endfunction()
|
||||
|
||||
# vim: set noet fenc=utf-8 ff=unix nowrap:
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PX4_SOURCE_DIR}/cmake/cmake_hexagon")
|
||||
include(hexagon_sdk)
|
||||
|
||||
@@ -52,12 +53,8 @@ if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
|
||||
)
|
||||
endif()
|
||||
|
||||
px4_add_module(
|
||||
MODULE platforms_px4_layer
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
${QURT_LAYER_SRCS}
|
||||
${CONFIG_SRC}
|
||||
DEPENDS
|
||||
platforms__common
|
||||
)
|
||||
add_library(px4_layer
|
||||
${QURT_LAYER_SRCS}
|
||||
${CONFIG_SRC}
|
||||
)
|
||||
add_dependencies(px4_layer uorb_msgs) # dataman requires mission
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <semaphore.h>
|
||||
#include <systemlib/param/param.h>
|
||||
#include <parameters/param.h>
|
||||
#include "hrt_work.h"
|
||||
#include "px4_log.h"
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <atomic_ops.h>
|
||||
|
||||
#include "systemlib/param/param.h"
|
||||
#include <parameters/param.h>
|
||||
|
||||
#include <shmem.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
Reference in New Issue
Block a user