Browse Source

Updated compilation with Makefile and Jamfile

Paul-Louis Ageneau 5 years ago
parent
commit
1566c0ef21
5 changed files with 18 additions and 6 deletions
  1. 9 0
      Jamfile
  2. 3 2
      Makefile
  3. 2 2
      include/rtc/include.hpp
  4. 2 1
      src/dtlstransport.cpp
  5. 2 1
      src/sctptransport.cpp

+ 9 - 0
Jamfile

@@ -13,10 +13,19 @@ lib libdatachannel
 	<link>static
 	: # usage requirements
 	<include>./include
+	<library>/libdatachannel//plog
 	<cxxflags>-pthread
 	<linkflags>"`pkg-config --libs openssl glib-2.0 gobject-2.0 nice`"
 	;
 
+alias plog
+    : # no sources
+    : # no build requirements
+    : # no default build
+    : # usage requirements
+    <include>./deps/plog/include
+    ;
+
 alias usrsctp
     : # no sources
     : # no build requirements

+ 3 - 2
Makefile

@@ -9,6 +9,7 @@ CXXFLAGS=-std=c++17
 LDFLAGS=-pthread
 LIBS=glib-2.0 gobject-2.0 nice
 USRSCTP_DIR=deps/usrsctp
+PLOG_DIR=deps/plog
 
 USE_GNUTLS ?= 0
 ifneq ($(USE_GNUTLS), 0)
@@ -20,7 +21,7 @@ else
 endif
 
 LDLIBS= $(shell pkg-config --libs $(LIBS))
-INCLUDES=-Iinclude/rtc -I$(USRSCTP_DIR)/usrsctplib $(shell pkg-config --cflags $(LIBS))
+INCLUDES=-Iinclude/rtc -I$(PLOG_DIR)/include -I$(USRSCTP_DIR)/usrsctplib $(shell pkg-config --cflags $(LIBS))
 
 SRCS=$(shell printf "%s " src/*.cpp)
 OBJS=$(subst .cpp,.o,$(SRCS))
@@ -31,7 +32,7 @@ src/%.o: src/%.cpp
 	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) -MMD -MP -o $@ -c $<
 
 test/%.o: test/%.cpp
-	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -Iinclude -MMD -MP -o $@ -c $<
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -Iinclude -I$(PLOG_DIR)/include -MMD -MP -o $@ -c $<
 
 -include $(subst .cpp,.d,$(SRCS))
 

+ 2 - 2
include/rtc/include.hpp

@@ -27,8 +27,8 @@
 #include <string>
 #include <vector>
 
-#include <plog/Appenders/ColorConsoleAppender.h>
-#include <plog/Log.h>
+#include "plog/Appenders/ColorConsoleAppender.h"
+#include "plog/Log.h"
 
 namespace rtc {
 

+ 2 - 1
src/dtlstransport.cpp

@@ -508,8 +508,9 @@ void DtlsTransport::InfoCallback(const SSL *ssl, int where, int ret) {
 	    static_cast<DtlsTransport *>(SSL_get_ex_data(ssl, DtlsTransport::TransportExIndex));
 
 	if (where & SSL_CB_ALERT) {
-		if (ret != 256) // Close Notify
+		if (ret != 256) { // Close Notify
 			PLOG_ERROR << "DTLS alert: " << SSL_alert_desc_string_long(ret);
+		}
 		t->mIncomingQueue.stop(); // Close the connection
 	}
 }

+ 2 - 1
src/sctptransport.cpp

@@ -202,8 +202,9 @@ void SctpTransport::connect() {
 void SctpTransport::shutdown() {
 	PLOG_DEBUG << "SCTP shutdown";
 
-	if (usrsctp_shutdown(mSock, SHUT_RDWR))
+	if (usrsctp_shutdown(mSock, SHUT_RDWR)) {
 		PLOG_WARNING << "SCTP shutdown failed, errno=" << errno;
+	}
 
 	PLOG_INFO << "SCTP disconnected";
 	changeState(State::Disconnected);