forked from Archive/PX4-Autopilot
update C++ standard (c++11 -> c++14)
- temporarily disable snapdragon builds until toolchain is updated
This commit is contained in:
parent
cf195b0755
commit
b47eaa6061
|
@ -50,7 +50,7 @@ pipeline {
|
|||
]
|
||||
|
||||
def docker_builds = [
|
||||
armhf_builds, base_builds, nuttx_builds_archive, snapdragon_builds
|
||||
armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
|
||||
]
|
||||
|
||||
for (def build_type = 0; build_type < docker_builds.size(); build_type++) {
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
"cortex-debug.enableTelemetry": false,
|
||||
"C_Cpp.clang_format_fallbackStyle": "none",
|
||||
"C_Cpp.configurationWarnings": "Disabled",
|
||||
"C_Cpp.default.cppStandard": "c++11",
|
||||
"C_Cpp.default.cStandard": "c99",
|
||||
"C_Cpp.default.cppStandard": "c++14",
|
||||
"C_Cpp.default.cStandard": "c11",
|
||||
"C_Cpp.default.intelliSenseMode": "gcc-x64",
|
||||
"C_Cpp.errorSquiggles": "Disabled",
|
||||
"C_Cpp.formatting": "Disabled",
|
||||
|
|
|
@ -51,8 +51,8 @@ flags = [
|
|||
# headers will be compiled as C headers. You don't want that so ALWAYS specify
|
||||
# a "-std=<something>".
|
||||
# For a C project, you would set this to something like 'c99' instead of
|
||||
# 'c++11'.
|
||||
'-std=c++11',
|
||||
# 'c++14'.
|
||||
'-std=c++14',
|
||||
# ...and the same thing goes for the magic -x option which specifies the
|
||||
# language that the files to be compiled are written in. This is mostly
|
||||
# relevant for c++ headers.
|
||||
|
|
|
@ -191,7 +191,7 @@ project(px4 CXX C ASM)
|
|||
|
||||
set(package-contact "px4users@googlegroups.com")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
|
2
Makefile
2
Makefile
|
@ -437,7 +437,7 @@ clang-tidy-quiet: px4_sitl_default-clang
|
|||
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
|
||||
cppcheck: px4_sitl_default
|
||||
@mkdir -p "$(SRC_DIR)"/build/cppcheck
|
||||
@cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++11 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null
|
||||
@cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++14 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null
|
||||
@cppcheck-htmlreport --source-encoding=ascii --file="$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml --report-dir="$(SRC_DIR)"/build/cppcheck --source-dir="$(SRC_DIR)"/src/
|
||||
|
||||
shellcheck_all:
|
||||
|
|
|
@ -38,15 +38,15 @@ project(micrortps_agent)
|
|||
find_package(fastrtps REQUIRED)
|
||||
find_package(fastcdr REQUIRED)
|
||||
|
||||
# Set C++11
|
||||
# Set C++14
|
||||
include(CheckCXXCompilerFlag)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
|
||||
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
check_cxx_compiler_flag(--std=c++11 SUPPORTS_CXX11)
|
||||
check_cxx_compiler_flag(--std=c++14 SUPPORTS_CXX14)
|
||||
if(SUPPORTS_CXX11)
|
||||
add_compile_options(--std=c++11)
|
||||
add_compile_options(--std=c++14)
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler doesn't support C++11")
|
||||
message(FATAL_ERROR "Compiler doesn't support C++14")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ CFLAGS = $(ARCHINCLUDES) \
|
|||
-Wno-type-limits
|
||||
|
||||
CXXFLAGS = $(ARCHXXINCLUDES) \
|
||||
-std=gnu++11 \
|
||||
-std=c++14 \
|
||||
-nostdinc++ \
|
||||
${CMAKE_CXX_FLAGS} \
|
||||
$(FLAGS) \
|
||||
|
@ -117,6 +117,7 @@ CXXFLAGS = $(ARCHXXINCLUDES) \
|
|||
-fno-builtin \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-fno-sized-deallocation \
|
||||
-nostdinc++ \
|
||||
-Wno-double-promotion \
|
||||
-Wno-missing-declarations
|
||||
|
|
|
@ -67,6 +67,8 @@ function(px4_os_add_flags)
|
|||
# prevent using the toolchain's std c++ library
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
|
||||
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-sized-deallocation>)
|
||||
|
||||
add_definitions(
|
||||
-D__PX4_NUTTX
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ include_directories(
|
|||
./include
|
||||
)
|
||||
|
||||
add_compile_options(-Wno-unused-variable)
|
||||
add_library(uavcan_kinetis_driver STATIC
|
||||
./src/uc_kinetis_flexcan.cpp
|
||||
./src/uc_kinetis_clock.cpp
|
||||
|
|
|
@ -693,7 +693,7 @@ void CanIface::handleRxInterrupt(uavcan::uint32_t rx_iflags, uavcan::uint64_t ut
|
|||
frame.data[7] = rf.data.b7;
|
||||
|
||||
volatile uavcan::uint32_t idhit = can_->RXFIR;
|
||||
UNUSED(idhit);
|
||||
|
||||
(void)can_->TIMER;
|
||||
can_->IFLAG1 = flexcan::CAN_FIFO_NE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue