diff options
Diffstat (limited to 'host/examples/init_usrp')
-rw-r--r-- | host/examples/init_usrp/CMakeLists.txt | 19 | ||||
-rw-r--r-- | host/examples/init_usrp/init_usrp.cpp | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/host/examples/init_usrp/CMakeLists.txt b/host/examples/init_usrp/CMakeLists.txt index 4ce51125f..139f9b853 100644 --- a/host/examples/init_usrp/CMakeLists.txt +++ b/host/examples/init_usrp/CMakeLists.txt @@ -46,6 +46,25 @@ find_package(UHD "3.8.0" REQUIRED) #find_package(UHD 3.8.1 EXACT REQUIRED) ### Configure Compiler ######################################################## +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() + include_directories( ${Boost_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS} diff --git a/host/examples/init_usrp/init_usrp.cpp b/host/examples/init_usrp/init_usrp.cpp index c0a211767..46650a583 100644 --- a/host/examples/init_usrp/init_usrp.cpp +++ b/host/examples/init_usrp/init_usrp.cpp @@ -20,7 +20,7 @@ // The program itself only initializes a USRP. For more elaborate examples, // have a look at the files in host/examples/. -#include <uhd/utils/thread_priority.hpp> +#include <uhd/utils/thread.hpp> #include <uhd/utils/safe_main.hpp> #include <uhd/usrp/multi_usrp.hpp> #include <boost/program_options.hpp> |