aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-06 08:56:39 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-06 08:56:39 +0100
commit462a5fae9065f2476d833ff26c24dd98650f2bf7 (patch)
tree518e9054f90767d0a5468f58a402832dc538c2e6 /unittests
parent87650e49e14adae8880dfd06e3d4a23bcb7ae3b1 (diff)
parent88d7c4e44798fb86d960b2fe2204213e62e6b660 (diff)
downloadpx4-firmware-462a5fae9065f2476d833ff26c24dd98650f2bf7.tar.gz
px4-firmware-462a5fae9065f2476d833ff26c24dd98650f2bf7.tar.bz2
px4-firmware-462a5fae9065f2476d833ff26c24dd98650f2bf7.zip
Merge remote-tracking branch 'upstream/master' into dev_ros
Diffstat (limited to 'unittests')
-rw-r--r--unittests/CMakeLists.txt10
-rw-r--r--unittests/Makefile6
2 files changed, 14 insertions, 2 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index d264ae8cd..ec3e4104e 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -19,6 +19,16 @@ function(add_gtest)
endforeach()
endfunction()
+include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(COMPILER_SUPPORTS_CXX0X)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+else()
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+endif()
# add each test
# todo: add mixer_test sbus2_test st24_test sf0x_test
diff --git a/unittests/Makefile b/unittests/Makefile
index 5faa50bb5..f25a56fc4 100644
--- a/unittests/Makefile
+++ b/unittests/Makefile
@@ -1,7 +1,7 @@
-CC=g++
+CC=$(CXX)
CFLAGS=-I. -I../src/modules -I ../src/include -I../src/drivers \
- -I../src -I../src/lib -D__EXPORT="" -Dnullptr="0" -lm
+ -I../src -I../src/lib -D__EXPORT="" -Dnullptr="0" -lm -std=c++11
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file.
@@ -53,6 +53,8 @@ MIXER_FILES=../src/systemcmds/tests/test_mixer.cpp \
hrt.cpp \
mixer_test.cpp
+include ../src/modules/systemlib/mixer/multi_tables.mk
+
SBUS2_FILES=../src/modules/px4iofirmware/sbus.c \
hrt.cpp \
sbus2_test.cpp