mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 14:43:33 +08:00
cmake: changes required for qurt build
Fixed CMakeLists.txt to be consistent with module.mk Converted PX4_TICKS_PER_SEC to define for QURT to get around relocation error Added stubs for QURT so building a full executable can be tested. This will enable CI testing without the full Hexagon SDK. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -7,9 +7,6 @@ message(STATUS "module list: ${module_dir_list}")
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
#add_custom_command(OUTPUT apps.h
|
||||
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/posix_apps.py > apps.h)
|
||||
|
||||
foreach(directory ${module_dir_list})
|
||||
message(STATUS "directory: ${directory}")
|
||||
px4_mangle_name(${directory} mangled_name)
|
||||
|
||||
@@ -15,8 +15,9 @@ foreach(directory ${module_dir_list})
|
||||
list(APPEND module_list
|
||||
${mangled_name})
|
||||
endforeach()
|
||||
|
||||
px4_qurt_generate_builtin_commands(
|
||||
OUT apps.h
|
||||
OUT ${CMAKE_BINARY_DIR}/apps.h
|
||||
MODULE_LIST ${module_list})
|
||||
|
||||
# FIXME @jgoppert - how to work around issues like this?
|
||||
@@ -25,9 +26,22 @@ px4_qurt_generate_builtin_commands(
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||
|
||||
add_library(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/qurt/px4_layer/main.cpp
|
||||
apps.h)
|
||||
# Enable build without HexagonSDK to check link dependencies
|
||||
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")
|
||||
add_executable(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/qurt/dspal/dspal_stub.c
|
||||
${CMAKE_BINARY_DIR}/apps.h)
|
||||
else("${QURT_ENABLE_STUBS}" STREQUAL "1")
|
||||
add_library(mainapp
|
||||
${CMAKE_SOURCE_DIR}/src/platforms/qurt/dspal/dspal_stub.c
|
||||
${CMAKE_BINARY_DIR}/apps.h)
|
||||
endif()
|
||||
|
||||
set(main_link_flags
|
||||
"-T${CMAKE_SOURCE_DIR}/cmake/posix/ld.script"
|
||||
)
|
||||
px4_join(OUT main_link_flags LIST ${main_link_flags} GLUE " ")
|
||||
set_target_properties(mainapp PROPERTIES LINK_FLAGS ${main_link_flags})
|
||||
|
||||
target_link_libraries(mainapp
|
||||
-Wl,--whole-archive
|
||||
|
||||
Reference in New Issue
Block a user