2020-11-24 02:50:37 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2022-07-05 23:41:51 +08:00
|
|
|
index 28b4566..4347b6a 100644
|
2020-11-24 02:50:37 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-12-22 12:06:10 +08:00
|
|
|
@@ -28,7 +28,6 @@ endif()
|
2021-09-03 09:03:41 +08:00
|
|
|
|
2022-04-27 09:48:48 +08:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
2021-08-05 18:09:16 +08:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
-set(BUILD_SHARED_LIBS OFF) # to force usrsctp to be built static
|
2020-11-24 02:50:37 +08:00
|
|
|
|
2021-08-05 18:09:16 +08:00
|
|
|
if(WIN32)
|
2021-09-03 09:03:41 +08:00
|
|
|
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
2022-07-05 23:41:51 +08:00
|
|
|
@@ -200,12 +199,14 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
2021-08-05 18:09:16 +08:00
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
|
|
|
find_package(Threads REQUIRED)
|
2021-04-10 01:01:14 +08:00
|
|
|
|
2021-08-05 18:09:16 +08:00
|
|
|
-set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
|
|
|
|
-add_subdirectory(deps/plog EXCLUDE_FROM_ALL)
|
2021-09-03 09:03:41 +08:00
|
|
|
+find_library(USRSCTP_LIBRARY usrsctp REQUIRED)
|
|
|
|
+find_path(PLOG_INCLUDE_DIRS "plog/Appenders/AndroidAppender.h")
|
|
|
|
|
2021-12-22 12:06:10 +08:00
|
|
|
if(SCTP_DEBUG)
|
|
|
|
add_definitions(-DSCTP_DEBUG)
|
|
|
|
endif()
|
2022-07-05 23:41:51 +08:00
|
|
|
+
|
2021-09-28 10:49:56 +08:00
|
|
|
+if(0)
|
2022-07-05 23:41:51 +08:00
|
|
|
option(sctp_build_shared_lib OFF)
|
|
|
|
option(sctp_build_programs OFF)
|
|
|
|
option(sctp_inet OFF)
|
|
|
|
@@ -219,8 +220,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
2021-09-28 10:49:56 +08:00
|
|
|
target_compile_options(usrsctp PRIVATE -Wno-error=format-truncation)
|
|
|
|
endif()
|
|
|
|
add_library(Usrsctp::Usrsctp ALIAS usrsctp)
|
|
|
|
+endif()
|
2021-12-22 12:06:10 +08:00
|
|
|
|
|
|
|
-add_library(datachannel SHARED
|
2021-04-10 01:01:14 +08:00
|
|
|
+add_library(datachannel
|
|
|
|
${LIBDATACHANNEL_SOURCES}
|
|
|
|
${LIBDATACHANNEL_HEADERS}
|
|
|
|
${LIBDATACHANNEL_IMPL_SOURCES}
|
2022-07-05 23:41:51 +08:00
|
|
|
@@ -244,16 +246,18 @@ target_include_directories(datachannel PUBLIC
|
2021-09-28 10:49:56 +08:00
|
|
|
$<INSTALL_INTERFACE:include>)
|
2020-11-24 02:50:37 +08:00
|
|
|
target_include_directories(datachannel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc)
|
|
|
|
target_include_directories(datachannel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|
|
|
+target_include_directories(datachannel PRIVATE ${PLOG_INCLUDE_DIRS})
|
2021-09-28 10:49:56 +08:00
|
|
|
target_link_libraries(datachannel PRIVATE Threads::Threads)
|
2021-08-05 18:09:16 +08:00
|
|
|
-target_link_libraries(datachannel PRIVATE Usrsctp::Usrsctp plog::plog)
|
|
|
|
+target_link_libraries(datachannel PRIVATE ${USRSCTP_LIBRARY})
|
2020-11-24 02:50:37 +08:00
|
|
|
|
2021-09-28 10:49:56 +08:00
|
|
|
target_include_directories(datachannel-static PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include>)
|
2020-11-24 02:50:37 +08:00
|
|
|
target_include_directories(datachannel-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/rtc)
|
|
|
|
target_include_directories(datachannel-static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
2021-08-05 18:09:16 +08:00
|
|
|
+target_include_directories(datachannel PRIVATE ${PLOG_INCLUDE_DIRS})
|
2021-09-28 10:49:56 +08:00
|
|
|
target_link_libraries(datachannel-static PRIVATE Threads::Threads)
|
2021-08-05 18:09:16 +08:00
|
|
|
-target_link_libraries(datachannel-static PRIVATE Usrsctp::Usrsctp plog::plog)
|
|
|
|
+target_link_libraries(datachannel-static PRIVATE ${USRSCTP_LIBRARY})
|
2020-11-24 02:50:37 +08:00
|
|
|
|
|
|
|
if(WIN32)
|
2021-04-10 01:01:14 +08:00
|
|
|
target_link_libraries(datachannel PUBLIC ws2_32) # winsock2
|