aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/transport/CMakeLists.txt')
-rw-r--r--host/lib/transport/CMakeLists.txt27
1 files changed, 19 insertions, 8 deletions
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
index a98bcc14e..a5bf9c5f1 100644
--- a/host/lib/transport/CMakeLists.txt
+++ b/host/lib/transport/CMakeLists.txt
@@ -48,20 +48,31 @@ ENDIF(ENABLE_USB)
########################################################################
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring interface address discovery...")
-
+INCLUDE(CheckCXXSourceCompiles)
INCLUDE(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(ifaddrs.h HAVE_IFADDRS_H)
+
+CHECK_CXX_SOURCE_COMPILES("
+ #include <ifaddrs.h>
+ int main(){
+ struct ifaddrs *ifap;
+ getifaddrs(&ifap);
+ return 0;
+ }
+ " HAVE_GETIFADDRS
+)
+
CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H)
-IF(HAVE_IFADDRS_H)
+IF(HAVE_GETIFADDRS)
MESSAGE(STATUS " Interface address discovery supported through getifaddrs.")
- SET(IF_ADDRS_DEFS HAVE_IFADDRS_H)
+ SET(IF_ADDRS_DEFS HAVE_GETIFADDRS)
ELSEIF(HAVE_WINSOCK2_H)
MESSAGE(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
- SET(IF_ADDRS_DEFS HAVE_WINSOCK2_H)
-ELSE(HAVE_IFADDRS_H)
+ SET(IF_ADDRS_DEFS HAVE_SIO_GET_INTERFACE_LIST)
+ELSE()
MESSAGE(STATUS " Interface address discovery not supported.")
-ENDIF(HAVE_IFADDRS_H)
+ SET(IF_ADDRS_DEFS HAVE_IF_ADDRS_DUMMY)
+ENDIF()
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_SOURCE_DIR}/if_addrs.cpp
@@ -80,6 +91,6 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/buffer_pool.cpp
${CMAKE_CURRENT_SOURCE_DIR}/if_addrs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/udp_simple.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy_asio.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/vrt_packet_handler.hpp
)