1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50:34 +00:00

fix gcc flags when building a package for arm. Fixing reporting when the

libgtest-dev package is detected.
This commit is contained in:
Carles Fernandez 2014-12-09 19:34:51 +01:00
parent 24006070cb
commit bd784cc9ff

View File

@ -269,11 +269,15 @@ if(EXISTS $ENV{GTEST_DIR})
endif(EXISTS $ENV{GTEST_DIR})
if(GTEST_DIR)
message(STATUS "GTEST root folder at ${GTEST_DIR}")
else()
message (STATUS " Googletest has not been found because the environment variable ")
message (STATUS " GTEST_DIR is not defined.")
message (STATUS " Googletest will be downloaded and built automatically ")
message (STATUS " when doing 'make'. ")
else(GTEST_DIR)
find_path(LIBGTEST_DEV_DIR NAMES gtest-all.cc PATHS /usr/src/gtest/src)
if(LIBGTEST_DEV_DIR)
message (STATUS " Googletest (libgtest-dev package) has been found.")
else(LIBGTEST_DEV_DIR)
message (STATUS " Googletest has not been found.")
message (STATUS " Googletest will be downloaded and built automatically ")
message (STATUS " when doing 'make'. ")
endif(LIBGTEST_DEV_DIR)
endif(GTEST_DIR)
@ -990,7 +994,7 @@ endif(ENABLE_RTLSDR)
# Enable C++11 support in GCC
# For "-std=c++0x" GCC's support for C++11 see http://gcc.gnu.org/projects/cxx0x.html
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++0x -Wall") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++0x -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing")
@ -1001,19 +1005,12 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Processor-architecture related flags
# See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
# Change to '-mtune=generic' when building for distribution (except when compiling for arm)
if (NOT ARCH_COMPILER_FLAGS)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if(OS_IS_MACOSX)
set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse")
else(OS_IS_MACOSX)
if(ENABLE_GENERIC_ARCH)
if(IS_ARM)
set(ARCH_COMPILER_FLAGS "-mtune=generic-arm")
else(IS_ARM)
set(ARCH_COMPILER_FLAGS "-mtune=generic")
endif(IS_ARM)
else(ENABLE_GENERIC_ARCH)
if(NOT ${ENABLE_GENERIC_ARCH})
if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html)
if(ARM_VERSION STREQUAL "arm")
# Unknown arm version - try our best to detect
@ -1024,7 +1021,7 @@ if (NOT ARCH_COMPILER_FLAGS)
else(IS_ARM)
set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse")
endif(IS_ARM)
endif(ENABLE_GENERIC_ARCH)
endif(NOT ${ENABLE_GENERIC_ARCH})
endif(OS_IS_MACOSX)
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif (NOT ARCH_COMPILER_FLAGS)