aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/deps/rpclib/CMakeLists.txt
blob: dd53fabe8682d7ea51cfa849279e4a4bef17e05f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PROJECT(UHD_RPCLIB CXX)

SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size")

SET(RPCLIB_VERISION_MAJOR 1)
SET(RPCLIB_VERSION_MINOR 0)
SET(RPCLIB_VERSION_PATCH 0)

CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/version.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/version.h)

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
    lib/rpc/dispatcher.cc
    lib/rpc/server.cc
    lib/rpc/client.cc
    lib/rpc/this_handler.cc
    lib/rpc/this_session.cc
    lib/rpc/this_server.cc
    lib/rpc/rpc_error.cc
    lib/rpc/detail/server_session.cc
    lib/rpc/detail/response.cc
    lib/rpc/detail/client_error.cc
)
SET_TARGET_PROPERTIES(uhd_rpclib
    PROPERTIES
    POSITION_INDEPENDENT_CODE ON
    COMPILE_DEFINITIONS "${RPCLIB_COMPILE_DEFINITIONS}"
)