Browse Source

Fixed and updated usrsctp then removed the usrsctp cmake hack

Paul-Louis Ageneau 5 years ago
parent
commit
36e4fdce1e
4 changed files with 8 additions and 33 deletions
  1. 3 3
      .gitmodules
  2. 3 28
      CMakeLists.txt
  3. 1 1
      deps/libjuice
  4. 1 1
      deps/usrsctp

+ 3 - 3
.gitmodules

@@ -1,9 +1,9 @@
-[submodule "usrsctp"]
-	path = deps/usrsctp
-	url = https://github.com/sctplab/usrsctp.git
 [submodule "deps/plog"]
 	path = deps/plog
 	url = https://github.com/SergiusTheBest/plog
+[submodule "usrsctp"]
+	path = deps/usrsctp
+	url = https://github.com/paullouisageneau/usrsctp.git
 [submodule "deps/libjuice"]
 	path = deps/libjuice
 	url = https://github.com/paullouisageneau/libjuice

+ 3 - 28
CMakeLists.txt

@@ -1,7 +1,7 @@
 cmake_minimum_required (VERSION 3.7)
 project (libdatachannel
 	DESCRIPTION "WebRTC Data Channels Library"
-	VERSION 0.4.0
+	VERSION 0.4.1
 	LANGUAGES CXX)
 
 option(USE_GNUTLS "Use GnuTLS instead of OpenSSL" OFF)
@@ -42,38 +42,13 @@ set(TESTS_ANSWERER_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/test/p2p/answerer.cpp
 )
 
-
-# Hack because usrsctp uses CMAKE_SOURCE_DIR instead of CMAKE_CURRENT_SOURCE_DIR
-set(CMAKE_REQUIRED_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/deps/usrsctp/usrsctplib")
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
 
 add_subdirectory(deps/usrsctp EXCLUDE_FROM_ALL)
-
-# Set include directory and custom options to make usrsctp compile with recent g++
-target_include_directories(usrsctp-static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/usrsctp/usrsctplib)
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  # using regular Clang or AppleClang: Needed since they don't have -Wno-error=format-truncation
-  target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member)
-else()
-  if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
-      # GCC version below 9.0 does not support option address-of-packed-member
-	  target_compile_options(usrsctp-static PRIVATE -Wno-error=format-truncation)
-	else()
-	  target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member -Wno-error=format-truncation)
-	endif()
-  else()
-    # all other compilers
-    target_compile_options(usrsctp-static PRIVATE -Wno-error=address-of-packed-member -Wno-error=format-truncation)
-  endif()
-endif()
-
 add_library(Usrsctp::Usrsctp ALIAS usrsctp)
 add_library(Usrsctp::UsrsctpStatic ALIAS usrsctp-static)
 
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-find_package(Threads REQUIRED)
-
 add_library(datachannel SHARED ${LIBDATACHANNEL_SOURCES})
 set_target_properties(datachannel PROPERTIES
 	VERSION ${PROJECT_VERSION}

+ 1 - 1
deps/libjuice

@@ -1 +1 @@
-Subproject commit eb9424084422e1e3b4e5fdf68a939047298e91fa
+Subproject commit 25b71f18dcbabd856e3c91bbe0dbe2537b83da61

+ 1 - 1
deps/usrsctp

@@ -1 +1 @@
-Subproject commit 04d617c9c194666747d0294526a388db053edaa7
+Subproject commit 8768f70504712eac15c6bfd58aab6ef08a11211b