diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-05-31 16:03:16 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:59 -0800 |
commit | ba287c272a19a512acbf9b650dd5775067f9bcdb (patch) | |
tree | 6daeb3775b15fd636832b8a04696df1308dacbe2 /host/lib | |
parent | d6dc8377ed0d1981c4757b14dab0d160486091a8 (diff) | |
download | uhd-ba287c272a19a512acbf9b650dd5775067f9bcdb.tar.gz uhd-ba287c272a19a512acbf9b650dd5775067f9bcdb.tar.bz2 uhd-ba287c272a19a512acbf9b650dd5775067f9bcdb.zip |
rpclib: Add more Windows compile definitions
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/deps/rpc_CMakeLists.txt | 33 | ||||
-rw-r--r-- | host/lib/deps/rpclib/CMakeLists.txt | 30 |
2 files changed, 59 insertions, 4 deletions
diff --git a/host/lib/deps/rpc_CMakeLists.txt b/host/lib/deps/rpc_CMakeLists.txt index 1ebb1b69c..c8cb322da 100644 --- a/host/lib/deps/rpc_CMakeLists.txt +++ b/host/lib/deps/rpc_CMakeLists.txt @@ -1,9 +1,8 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) PROJECT(UHD_RPCLIB CXX) SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size") -SET(RPCLIB_VERISION_MAJOR ${rpclib_major_version}) +SET(RPCLIB_VERSION_MAJOR ${rpclib_major_version}) SET(RPCLIB_VERSION_MINOR ${rpclib_minor_version}) SET(RPCLIB_VERSION_PATCH ${rpclib_patch_version}) @@ -15,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 @@ -29,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}"}" +) + 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}" +) + |