diff options
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r-- | host/CMakeLists.txt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 30a05ef9c..8def96811 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -80,9 +80,25 @@ ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ENDIF() ENDIF() +IF(CMAKE_VERSION VERSION_LESS "3.1") + IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + SET(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}") + ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + IF("${IS_APPLE}" STREQUAL "") + SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") + ELSE() + SET(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}") + ENDIF() + ENDIF() +ELSE() + SET(CMAKE_CXX_STANDARD 11) +ENDIF() + IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") SET(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}") + SET(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") ENDIF() + ######################################################################## # Packaging Variables ######################################################################## @@ -177,7 +193,7 @@ INCLUDE(CheckCXXCompilerFlag) MACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG flag have) CHECK_CXX_COMPILER_FLAG(${flag} ${have}) IF(${have}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") ENDIF(${have}) ENDMACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG) @@ -195,7 +211,7 @@ IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") IF(STRIP_BINARIES) IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") ENDIF(STRIP_BINARIES) ADD_DEFINITIONS(-Wall) @@ -289,6 +305,7 @@ MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}") # Note: RFNoC never gets fully disabled, but the public APIs do SET(ENABLE_RFNOC OFF CACHE BOOL "Export RFNoC includes and symbols") INCLUDE(UHDGlobalDefs) +INCLUDE(UHDLog) ######################################################################## # Check Python Modules |