mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 01:04:19 +08:00
Enabled C++11 for tests target
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
CC=g++
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user