diff options
Diffstat (limited to 'host/lib/deps/rpclib/CMakeLists.txt')
-rw-r--r-- | host/lib/deps/rpclib/CMakeLists.txt | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/host/lib/deps/rpclib/CMakeLists.txt b/host/lib/deps/rpclib/CMakeLists.txt index 271a49854..dd53fabe8 100644 --- a/host/lib/deps/rpclib/CMakeLists.txt +++ b/host/lib/deps/rpclib/CMakeLists.txt @@ -14,6 +14,29 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +SET(RPCLIB_COMPILE_DEFINITIONS "") +IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + +ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + +ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + SET(RPCLIB_COMPILE_DEFINITIONS + "${RPCLIB_COMPILE_DEFINITIONS}" + "WIN32_LEAN_AND_MEAN" + "NOMINMAX" + "VC_EXTRALEAN" + "_CRT_SECURE_NO_WARNINGS" + "_CRT_NONSTDC_NO_DEPRECATE" + "_WIN32_WINNT=0x0501" + "_GNU_SOURCE" + "ASIO_HAS_STD_ADDRESSOF" + "ASIO_HAS_STD_ARRAY" + "ASIO_HAS_CSTDINT" + "ASIO_HAS_STD_SHARED_PTR" + "ASIO_HAS_STD_TYPE_TRAITS" + ) +ENDIF() + INCLUDE_DIRECTORIES(include) INCLUDE_DIRECTORIES(include/rpc) ADD_LIBRARY(uhd_rpclib OBJECT @@ -28,4 +51,9 @@ ADD_LIBRARY(uhd_rpclib OBJECT lib/rpc/detail/response.cc lib/rpc/detail/client_error.cc ) -SET_PROPERTY(TARGET uhd_rpclib PROPERTY POSITION_INDEPENDENT_CODE ON) +SET_TARGET_PROPERTIES(uhd_rpclib + PROPERTIES + POSITION_INDEPENDENT_CODE ON + COMPILE_DEFINITIONS "${RPCLIB_COMPILE_DEFINITIONS}" +) + |