From fa8cb9dd5c17e4e4aad72a95d52ea9831cbd818d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 23 Aug 2017 19:04:11 +0200 Subject: [PATCH] Fix building when compilers have a C++ standard below C++11 --- CMakeLists.txt | 30 ------------------- .../volk_gnsssdr/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd63b0089..773af075a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,34 +582,6 @@ if(NOT VOLK_GNSSSDR_FOUND) endif(CMAKE_GENERATOR STREQUAL Xcode) endif(OS_IS_MACOSX) - set(C_FLAGS "${CMAKE_C_FLAGS} -std=c11") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - - if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) - - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(OS_IS_LINUX) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - endif(OS_IS_LINUX) - if(OS_IS_MACOSX) - if(CLANG_VERSION VERSION_LESS "600") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - else(CLANG_VERSION VERSION_LESS "600") - set(CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - endif(CLANG_VERSION VERSION_LESS "600") - endif(OS_IS_MACOSX) - endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(CMAKE_CROSSCOMPILING) set(VOLK_GNSSSDR_COMPILER "") else(CMAKE_CROSSCOMPILING) @@ -619,8 +591,6 @@ if(NOT VOLK_GNSSSDR_FOUND) -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON -DENABLE_PROFILING=${ENABLE_PROFILING} - -DCMAKE_CXX_FLAGS=${CXX_FLAGS} - -DCMAKE_C_FLAGS=${C_FLAGS} -DCMAKE_INCLUDE_PATH=${Boost_INCLUDE_DIR} -DENABLE_ORC=OFF ${STRIP_VOLK_GNSSSDR_PROFILE} diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index d6e69819b..8178609a2 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -27,7 +27,7 @@ enable_language(CXX) enable_language(C) enable_testing() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)