mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
Merge pull request #2906 from mcharleb/cmake-2-qurt-unbreakage
Cmake 2 qurt unbreakage
This commit is contained in:
@@ -219,7 +219,6 @@ px4_add_git_submodule(TARGET git_gtest PATH "unittets/gtest")
|
|||||||
px4_add_git_submodule(TARGET git_uavcan PATH "src/lib/uavcan")
|
px4_add_git_submodule(TARGET git_uavcan PATH "src/lib/uavcan")
|
||||||
px4_add_git_submodule(TARGET git_eigen PATH "src/lib/eigen")
|
px4_add_git_submodule(TARGET git_eigen PATH "src/lib/eigen")
|
||||||
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
|
px4_add_git_submodule(TARGET git_nuttx PATH "NuttX")
|
||||||
px4_add_git_submodule(TARGET git_eigen32 PATH "src/lib/eigen-3.2")
|
|
||||||
px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal")
|
px4_add_git_submodule(TARGET git_dspal PATH "src/lib/dspal")
|
||||||
|
|
||||||
add_custom_target(submodule_clean
|
add_custom_target(submodule_clean
|
||||||
|
|||||||
@@ -486,7 +486,6 @@ function(px4_add_common_flags)
|
|||||||
-Wextra
|
-Wextra
|
||||||
#-Wshadow # very verbose due to eigen
|
#-Wshadow # very verbose due to eigen
|
||||||
-Wfloat-equal
|
-Wfloat-equal
|
||||||
-Wframe-larger-than=1024
|
|
||||||
-Wpointer-arith
|
-Wpointer-arith
|
||||||
-Wmissing-declarations
|
-Wmissing-declarations
|
||||||
-Wpacked
|
-Wpacked
|
||||||
@@ -506,10 +505,17 @@ function(px4_add_common_flags)
|
|||||||
# but generates too many false positives
|
# but generates too many false positives
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (NOT ${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND warnings -Wframe-larger-than=1024)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||||
list(APPEND warnings
|
# QuRT 6.4.X compiler identifies as Clang but does not support this option
|
||||||
-Wno-unused-const-variable
|
if (NOT ${OS} STREQUAL "qurt")
|
||||||
)
|
list(APPEND warnings
|
||||||
|
-Wno-unused-const-variable
|
||||||
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
list(APPEND warnings
|
list(APPEND warnings
|
||||||
-Werror=unused-but-set-variable
|
-Werror=unused-but-set-variable
|
||||||
@@ -609,11 +615,9 @@ function(px4_add_common_flags)
|
|||||||
${CMAKE_SOURCE_DIR}/mavlink/include/mavlink
|
${CMAKE_SOURCE_DIR}/mavlink/include/mavlink
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT ${OS} STREQUAL "qurt")
|
list(APPEND added_include_dirs
|
||||||
list(APPEND added_include_dirs
|
src/lib/eigen
|
||||||
${CMAKE_SOURCE_DIR}/src/lib/eigen
|
)
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(added_link_dirs) # none used currently
|
set(added_link_dirs) # none used currently
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
include(qurt/px4_impl_qurt)
|
include(qurt/px4_impl_qurt)
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/device
|
drivers/device
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
include(qurt/px4_impl_qurt)
|
include(qurt/px4_impl_qurt)
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/device
|
drivers/device
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
include(qurt/px4_impl_qurt)
|
include(qurt/px4_impl_qurt)
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/device
|
drivers/device
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set(target_libraries
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
include(qurt/px4_impl_qurt)
|
include(qurt/px4_impl_qurt)
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/device
|
drivers/device
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include(qurt/px4_impl_qurt)
|
|||||||
# Run a full link with build stubs to make sure qurt target isn't broken
|
# Run a full link with build stubs to make sure qurt target isn't broken
|
||||||
set(QURT_ENABLE_STUBS "1")
|
set(QURT_ENABLE_STUBS "1")
|
||||||
|
|
||||||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon.cmake)
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchains/Toolchain-hexagon-7.4.cmake)
|
||||||
|
|
||||||
set(config_module_list
|
set(config_module_list
|
||||||
drivers/device
|
drivers/device
|
||||||
@@ -41,6 +41,7 @@ set(config_module_list
|
|||||||
modules/systemlib/mixer
|
modules/systemlib/mixer
|
||||||
modules/uORB
|
modules/uORB
|
||||||
modules/commander
|
modules/commander
|
||||||
|
modules/controllib
|
||||||
|
|
||||||
#
|
#
|
||||||
# Libraries
|
# Libraries
|
||||||
@@ -50,7 +51,7 @@ set(config_module_list
|
|||||||
lib/geo
|
lib/geo
|
||||||
lib/geo_lookup
|
lib/geo_lookup
|
||||||
lib/conversion
|
lib/conversion
|
||||||
modules/controllib
|
lib/ecl
|
||||||
|
|
||||||
#
|
#
|
||||||
# QuRT port
|
# QuRT port
|
||||||
|
|||||||
@@ -167,7 +167,6 @@ function(px4_os_add_flags)
|
|||||||
${DSPAL_ROOT}/uart_esc/inc
|
${DSPAL_ROOT}/uart_esc/inc
|
||||||
src/platforms/qurt/include
|
src/platforms/qurt/include
|
||||||
src/platforms/posix/include
|
src/platforms/posix/include
|
||||||
src/lib/eigen-3.2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(added_definitions
|
set(added_definitions
|
||||||
@@ -223,11 +222,14 @@ function(px4_os_prebuild_targets)
|
|||||||
ONE_VALUE OUT BOARD THREADS
|
ONE_VALUE OUT BOARD THREADS
|
||||||
REQUIRED OUT BOARD
|
REQUIRED OUT BOARD
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
add_custom_target(${OUT} DEPENDS git_dspal git_eigen32)
|
add_custom_target(git_eigen_patched
|
||||||
add_custom_target(ALL DEPENDS git_eigen32)
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/eigen
|
||||||
execute_process(
|
COMMAND git checkout .
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/lib/eigen-3.2
|
COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/cmake/qurt/qurt_eigen.patch
|
||||||
COMMAND patch -p1 -i ../../../cmake/qurt/qurt_eigen.patch)
|
DEPENDS git_eigen)
|
||||||
|
add_custom_target(${OUT} DEPENDS git_dspal git_eigen_patched)
|
||||||
|
add_custom_target(ALL DEPENDS git_eigen)
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# vim: set noet fenc=utf-8 ff=unix nowrap:
|
# vim: set noet fenc=utf-8 ff=unix nowrap:
|
||||||
|
|||||||
+35
-15
@@ -1,17 +1,37 @@
|
|||||||
This patch is required for QuRT. complex.h defines "I" and it replaces "I" in the
|
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
|
||||||
enum definition without this patch creating an error.
|
index 1ca1d66..9bc928b 100644
|
||||||
|
--- a/Eigen/src/Core/util/Macros.h
|
||||||
diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h
|
+++ b/Eigen/src/Core/util/Macros.h
|
||||||
index ef17f28..1116270 100644
|
@@ -194,6 +194,12 @@
|
||||||
--- a/Eigen/src/Core/SolveTriangular.h
|
#define EIGEN_ARCH_PPC 0
|
||||||
+++ b/Eigen/src/Core/SolveTriangular.h
|
#endif
|
||||||
@@ -112,6 +112,9 @@ template<typename Lhs, typename Rhs, int Mode, int Index, int Size,
|
|
||||||
bool Stop = Index==Size>
|
|
||||||
struct triangular_solver_unroller;
|
|
||||||
|
|
||||||
+#ifdef __PX4_QURT
|
+/// \internal EIGEN_ARCH_HEXAGON set to 1 if the architecture is Hexagon
|
||||||
+#undef I
|
+#ifdef __HEXAGON_ARCH__
|
||||||
|
+ #define EIGEN_ARCH_HEXAGON 1
|
||||||
|
+#else
|
||||||
|
+ #define EIGEN_ARCH_HEXAGON 0
|
||||||
+#endif
|
+#endif
|
||||||
template<typename Lhs, typename Rhs, int Mode, int Index, int Size>
|
|
||||||
struct triangular_solver_unroller<Lhs,Rhs,Mode,Index,Size,false> {
|
|
||||||
enum {
|
// Operating system identification, EIGEN_OS_*
|
||||||
|
@@ -334,15 +340,16 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Do we support r-value references?
|
||||||
|
-#if (__has_feature(cxx_rvalue_references) || \
|
||||||
|
+#if ((__has_feature(cxx_rvalue_references) || \
|
||||||
|
(defined(__cplusplus) && __cplusplus >= 201103L) || \
|
||||||
|
defined(__GXX_EXPERIMENTAL_CXX0X__) || \
|
||||||
|
- (EIGEN_COMP_MSVC >= 1600))
|
||||||
|
+ (EIGEN_COMP_MSVC >= 1600)) && (!defined(EIGEN_ARCH_HEXAGON)))
|
||||||
|
#define EIGEN_HAVE_RVALUE_REFERENCES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Does the compiler support result_of?
|
||||||
|
-#if (__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L))
|
||||||
|
+#if ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)) && \
|
||||||
|
+ (!defined(EIGEN_ARCH_HEXAGON)))
|
||||||
|
#define EIGEN_HAS_STD_RESULT_OF 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,240 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2015 Mark Charlebois. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in
|
||||||
|
# the documentation and/or other materials provided with the
|
||||||
|
# distribution.
|
||||||
|
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software
|
||||||
|
# without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#
|
||||||
|
|
||||||
|
include(CMakeForceCompiler)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||||
|
include(common/px4_base)
|
||||||
|
|
||||||
|
if(NOT HEXAGON_TOOLS_ROOT)
|
||||||
|
set(HEXAGON_TOOLS_ROOT /opt/7.4/Tools)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
macro (list2string out in)
|
||||||
|
set(list ${ARGV})
|
||||||
|
list(REMOVE_ITEM list ${out})
|
||||||
|
foreach(item ${list})
|
||||||
|
set(${out} "${${out}} ${item}")
|
||||||
|
endforeach()
|
||||||
|
endmacro(list2string)
|
||||||
|
|
||||||
|
set(V_ARCH "v5")
|
||||||
|
set(CROSSDEV "hexagon-")
|
||||||
|
set(HEXAGON_BIN ${HEXAGON_TOOLS_ROOT}/bin)
|
||||||
|
set(HEXAGON_LIB_DIR ${HEXAGON_TOOLS_ROOT}/gnu/hexagon/lib)
|
||||||
|
set(HEXAGON_ISS_DIR ${HEXAGON_TOOLS_ROOT}/lib/iss)
|
||||||
|
set(TOOLSLIB ${HEXAGON_TOOLS_ROOT}/target/hexagon/lib/${V_ARCH}/G0)
|
||||||
|
|
||||||
|
# Use the HexagonTools compiler (6.4.05)
|
||||||
|
set(CMAKE_C_COMPILER ${HEXAGON_BIN}/${CROSSDEV}clang)
|
||||||
|
set(CMAKE_CXX_COMPILER ${HEXAGON_BIN}/${CROSSDEV}clang++)
|
||||||
|
|
||||||
|
set(CMAKE_AR ${HEXAGON_BIN}/${CROSSDEV}ar CACHE FILEPATH "Archiver")
|
||||||
|
set(CMAKE_RANLIB ${HEXAGON_BIN}/${CROSSDEV}ranlib)
|
||||||
|
set(CMAKE_LINKER ${HEXAGON_BIN}/${CROSSDEV}ld.qcld)
|
||||||
|
set(CMAKE_NM ${HEXAGON_BIN}/${CROSSDEV}nm)
|
||||||
|
set(CMAKE_OBJDUMP ${HEXAGON_BIN}/${CROSSDEV}objdump)
|
||||||
|
set(CMAKE_OBJCOPY ${HEXAGON_BIN}/${CROSSDEV}objcopy)
|
||||||
|
|
||||||
|
list2string(HEXAGON_INCLUDE_DIRS
|
||||||
|
-I${HEXAGON_TOOLS_ROOT}/target/hexagon/include
|
||||||
|
)
|
||||||
|
|
||||||
|
#set(DYNAMIC_LIBS -Wl,${TOOLSLIB}/pic/libstdc++.a)
|
||||||
|
|
||||||
|
#set(MAXOPTIMIZATION -O0)
|
||||||
|
|
||||||
|
# Base CPU flags for each of the supported architectures.
|
||||||
|
#
|
||||||
|
set(ARCHCPUFLAGS
|
||||||
|
-m${V_ARCH}
|
||||||
|
-G0
|
||||||
|
)
|
||||||
|
|
||||||
|
add_definitions(
|
||||||
|
-D_PID_T -D_UID_T -D_TIMER_T
|
||||||
|
-Dnoreturn_function=
|
||||||
|
-D__EXPORT=
|
||||||
|
-Drestrict=
|
||||||
|
-D_DEBUG
|
||||||
|
-Wno-error=shadow
|
||||||
|
)
|
||||||
|
|
||||||
|
# optimisation flags
|
||||||
|
#
|
||||||
|
set(ARCHOPTIMIZATION
|
||||||
|
-O0
|
||||||
|
-g
|
||||||
|
-fno-strict-aliasing
|
||||||
|
-fdata-sections
|
||||||
|
-fno-zero-initialized-in-bss
|
||||||
|
)
|
||||||
|
|
||||||
|
# Language-specific flags
|
||||||
|
#
|
||||||
|
set(ARCHCFLAGS
|
||||||
|
-std=gnu99
|
||||||
|
-D__CUSTOM_FILE_IO__
|
||||||
|
)
|
||||||
|
set(ARCHCXXFLAGS
|
||||||
|
-fno-exceptions
|
||||||
|
-fno-rtti
|
||||||
|
-std=c++11
|
||||||
|
-fno-threadsafe-statics
|
||||||
|
-DCONFIG_WCHAR_BUILTIN
|
||||||
|
-D__CUSTOM_FILE_IO__
|
||||||
|
)
|
||||||
|
|
||||||
|
set(ARCHWARNINGS
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Werror
|
||||||
|
-Wno-unused-parameter
|
||||||
|
-Wno-unused-function
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-gnu-array-member-paren-init
|
||||||
|
-Wno-cast-align
|
||||||
|
-Wno-missing-braces
|
||||||
|
-Wno-strict-aliasing
|
||||||
|
# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+
|
||||||
|
# -Wcast-qual - generates spurious noreturn attribute warnings, try again later
|
||||||
|
# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code
|
||||||
|
# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives
|
||||||
|
)
|
||||||
|
|
||||||
|
# C-specific warnings
|
||||||
|
#
|
||||||
|
set(ARCHCWARNINGS
|
||||||
|
${ARCHWARNINGS}
|
||||||
|
-Wstrict-prototypes
|
||||||
|
-Wnested-externs
|
||||||
|
)
|
||||||
|
|
||||||
|
# C++-specific warnings
|
||||||
|
#
|
||||||
|
set(ARCHWARNINGSXX
|
||||||
|
${ARCHWARNINGS}
|
||||||
|
-Wno-missing-field-initializers
|
||||||
|
)
|
||||||
|
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC)
|
||||||
|
exec_program(${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ARGS -print-file-name=libm.a OUTPUT_VARIABLE LIBM)
|
||||||
|
set(EXTRA_LIBS ${EXTRA_LIBS} ${LIBM})
|
||||||
|
|
||||||
|
# Flags we pass to the C compiler
|
||||||
|
#
|
||||||
|
list2string(CFLAGS
|
||||||
|
${ARCHCFLAGS}
|
||||||
|
${ARCHCWARNINGS}
|
||||||
|
${ARCHOPTIMIZATION}
|
||||||
|
${ARCHCPUFLAGS}
|
||||||
|
${ARCHINCLUDES}
|
||||||
|
${INSTRUMENTATIONDEFINES}
|
||||||
|
${ARCHDEFINES}
|
||||||
|
${EXTRADEFINES}
|
||||||
|
${EXTRACFLAGS}
|
||||||
|
${HEXAGON_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Flags we pass to the C++ compiler
|
||||||
|
#
|
||||||
|
list2string(CXXFLAGS
|
||||||
|
${ARCHCXXFLAGS}
|
||||||
|
${ARCHWARNINGSXX}
|
||||||
|
${ARCHOPTIMIZATION}
|
||||||
|
${ARCHCPUFLAGS}
|
||||||
|
${ARCHXXINCLUDES}
|
||||||
|
${INSTRUMENTATIONDEFINES}
|
||||||
|
${ARCHDEFINES}
|
||||||
|
${EXTRADEFINES}
|
||||||
|
${EXTRACXXFLAGS}
|
||||||
|
${HEXAGON_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Flags we pass to the assembler
|
||||||
|
#
|
||||||
|
list2string(AFLAGS
|
||||||
|
${CFLAGS}
|
||||||
|
-D__ASSEMBLY__
|
||||||
|
${EXTRADEFINES}
|
||||||
|
${EXTRAAFLAGS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set cmake flags
|
||||||
|
#
|
||||||
|
list2string(CMAKE_C_FLAGS
|
||||||
|
${CMAKE_C_FLAGS}
|
||||||
|
${CFLAGS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(QURT_CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "cflags")
|
||||||
|
|
||||||
|
message(STATUS "CMAKE_C_FLAGS: -${CMAKE_C_FLAGS}-")
|
||||||
|
|
||||||
|
list2string(CMAKE_CXX_FLAGS
|
||||||
|
${CMAKE_CXX_FLAGS}
|
||||||
|
${CXXFLAGS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(QURT_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "cxxflags")
|
||||||
|
|
||||||
|
message(STATUS "CMAKE_CXX_FLAGS: -${CMAKE_CXX_FLAGS}-")
|
||||||
|
|
||||||
|
# Flags we pass to the linker
|
||||||
|
#
|
||||||
|
list2string(CMAKE_EXE_LINKER_FLAGS
|
||||||
|
-g
|
||||||
|
-mv5
|
||||||
|
-mG0lib
|
||||||
|
-G0
|
||||||
|
-fpic
|
||||||
|
-shared
|
||||||
|
-Wl,-Bsymbolic
|
||||||
|
-Wl,--wrap=malloc
|
||||||
|
-Wl,--wrap=calloc
|
||||||
|
-Wl,--wrap=free
|
||||||
|
-Wl,--wrap=realloc
|
||||||
|
-Wl,--wrap=memalign
|
||||||
|
-Wl,--wrap=__stack_chk_fail
|
||||||
|
-lc
|
||||||
|
${EXTRALDFLAGS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# where is the target environment
|
||||||
|
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_ID, "Clang")
|
||||||
|
set(CMAKE_CXX_COMPILER_ID, "Clang")
|
||||||
|
|
||||||
|
# search for programs in the build host directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
# for libraries and headers in the target directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <px4_time.h>
|
||||||
#include <queue.h>
|
#include <queue.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
set(V_ARCH v5)
|
|
||||||
set(HEXAGON_TOOLS_ROOT /opt/6.4.03)
|
|
||||||
set(TOOLSLIB
|
|
||||||
${HEXAGON_TOOLS_ROOT}/dinkumware/lib/${V_ARCH}/G0)
|
|
||||||
|
|
||||||
px4_qurt_generate_builtin_commands(
|
px4_qurt_generate_builtin_commands(
|
||||||
OUT ${CMAKE_BINARY_DIR}/apps.h
|
OUT ${CMAKE_BINARY_DIR}/apps.h
|
||||||
MODULE_LIST ${module_libraries})
|
MODULE_LIST ${module_libraries})
|
||||||
|
|||||||
+1
-1
Submodule src/lib/dspal updated: 229f2f4d84...95e91546f4
@@ -29,12 +29,17 @@
|
|||||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
#############################################################################
|
||||||
|
set(MODULE_CFLAGS)
|
||||||
|
if (NOT ${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND MODULE_CFLAGS
|
||||||
|
-Wframe-larger-than=1400)
|
||||||
|
endif()
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__attitude_estimator_q
|
MODULE modules__attitude_estimator_q
|
||||||
MAIN attitude_estimator_q
|
MAIN attitude_estimator_q
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Wframe-larger-than=1400
|
${MODULE_CFLAGS}
|
||||||
STACK 1200
|
STACK 1200
|
||||||
SRCS
|
SRCS
|
||||||
attitude_estimator_q_main.cpp
|
attitude_estimator_q_main.cpp
|
||||||
|
|||||||
@@ -30,13 +30,18 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
set(MODULE_CFLAGS -Os)
|
||||||
|
|
||||||
|
if(NOT ${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND MODULE_CFLAGS
|
||||||
|
-Wframe-larger-than=2200)
|
||||||
|
endif()
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__commander
|
MODULE modules__commander
|
||||||
MAIN commander
|
MAIN commander
|
||||||
STACK 5000
|
STACK 5000
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Wframe-larger-than=2200
|
${MODULE_CFLAGS}
|
||||||
-Os
|
|
||||||
SRCS
|
SRCS
|
||||||
commander.cpp
|
commander.cpp
|
||||||
commander_params.c
|
commander_params.c
|
||||||
|
|||||||
@@ -30,13 +30,16 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
set(MODULE_CFLAGS -Weffc++)
|
||||||
|
if(NOT ${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND MODULE_CFLAGS -Wframe-larger-than=3400)
|
||||||
|
endif()
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__ekf_att_pos_estimator
|
MODULE modules__ekf_att_pos_estimator
|
||||||
MAIN ekf_att_pos_estimator
|
MAIN ekf_att_pos_estimator
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS ${MODULE_CFLAGS}
|
||||||
-Weffc++
|
|
||||||
-Wframe-larger-than=3400
|
|
||||||
-O3
|
|
||||||
SRCS
|
SRCS
|
||||||
ekf_att_pos_estimator_main.cpp
|
ekf_att_pos_estimator_main.cpp
|
||||||
ekf_att_pos_estimator_params.c
|
ekf_att_pos_estimator_params.c
|
||||||
|
|||||||
@@ -30,12 +30,15 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
set(MODULE_CFLAGS)
|
||||||
|
if(NOT ${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND MODULE_CFLAGS -Wframe-larger-than=3800)
|
||||||
|
endif()
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__position_estimator_inav
|
MODULE modules__position_estimator_inav
|
||||||
MAIN position_estimator_inav
|
MAIN position_estimator_inav
|
||||||
STACK 1200
|
STACK 1200
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS ${MODULE_CFLAGS}
|
||||||
-Wframe-larger-than=3800
|
|
||||||
|
|
||||||
SRCS
|
SRCS
|
||||||
position_estimator_inav_main.c
|
position_estimator_inav_main.c
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
int init_sensor_class(const struct orb_metadata *meta, int *subs,
|
int init_sensor_class(const struct orb_metadata *meta, int *subs,
|
||||||
unsigned *priorities, unsigned *errcount);
|
uint32_t *priorities, uint32_t *errcount);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update our local parameter cache.
|
* Update our local parameter cache.
|
||||||
@@ -1949,7 +1949,7 @@ Sensors::task_main_trampoline(int argc, char *argv[])
|
|||||||
|
|
||||||
int
|
int
|
||||||
Sensors::init_sensor_class(const struct orb_metadata *meta, int *subs,
|
Sensors::init_sensor_class(const struct orb_metadata *meta, int *subs,
|
||||||
unsigned *priorities, unsigned *errcount)
|
uint32_t *priorities, uint32_t *errcount)
|
||||||
{
|
{
|
||||||
unsigned group_count = orb_group_count(meta);
|
unsigned group_count = orb_group_count(meta);
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include <px4_config.h>
|
#include <px4_config.h>
|
||||||
#include <px4_defines.h>
|
#include <px4_defines.h>
|
||||||
|
#include <px4_posix.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -37,10 +37,12 @@
|
|||||||
* High-resolution timer with callouts and timekeeping.
|
* High-resolution timer with callouts and timekeeping.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <px4_defines.h>
|
||||||
#include <px4_workqueue.h>
|
#include <px4_workqueue.h>
|
||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <dspal_time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,18 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
set(MIXER_CFLAGS -Os)
|
||||||
|
if(${OS} STREQUAL "qurt")
|
||||||
|
list(APPEND MIXER_CFLAGS -Wframe-larger-than=2176)
|
||||||
|
else()
|
||||||
|
list(APPEND MIXER_CFLAGS -Wframe-larger-than=2048)
|
||||||
|
endif()
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE systemcmds__mixer
|
MODULE systemcmds__mixer
|
||||||
MAIN mixer
|
MAIN mixer
|
||||||
STACK 4096
|
STACK 4096
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS ${MIXER_CFLAGS}
|
||||||
-Wframe-larger-than=2048
|
|
||||||
-Os
|
|
||||||
SRCS
|
SRCS
|
||||||
mixer.cpp
|
mixer.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
|||||||
Reference in New Issue
Block a user