1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-21 09:34:53 +00:00

Replace CMAKE_COMPILER_IS_GNUCXX by CMAKE_CXX_COMPILER_ID

This commit is contained in:
Carles Fernandez
2018-11-17 14:31:06 +01:00
parent b9fb38d71e
commit bec3775f23
4 changed files with 26 additions and 31 deletions

View File

@@ -63,7 +63,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Enable C++14 support in 8.0.0 > GCC >= 6.1.1
# Fallback to C++11 when using GCC < 6.1.1
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
@@ -74,7 +74,7 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -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)
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
# Enable C++17 support in Clang >= 6.0.0
# Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600
@@ -100,12 +100,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
endif(NOT (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")

View File

@@ -75,10 +75,10 @@ endif(ENABLE_STATIC_LIBS)
if(ENABLE_STRIP)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
set_target_properties(volk_gnsssdr_profile
PROPERTIES LINK_FLAGS "-s")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
endif(ENABLE_STRIP)
@@ -99,10 +99,10 @@ else(ENABLE_STATIC_LIBS)
endif(ENABLE_STATIC_LIBS)
if(ENABLE_STRIP)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
set_target_properties(volk_gnsssdr-config-info
PROPERTIES LINK_FLAGS "-s")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
endif(ENABLE_STRIP)
install(