Browse Source

Updated Jamfile to allow GnuTLS

Paul-Louis Ageneau 5 years ago
parent
commit
6a7296d40d
1 changed files with 23 additions and 4 deletions
  1. 23 4
      Jamfile

+ 23 - 4
Jamfile

@@ -1,3 +1,5 @@
+import feature : feature ;
+
 project libdatachannel ;
 path-constant CWD : . ;
 
@@ -5,21 +7,26 @@ lib libdatachannel
 	: # sources
 	[ glob ./src/*.cpp ]
 	: # requirements
+	<cxxstd>17
 	<include>./include/rtc
-	<define>USE_GNUTLS=0
 	<define>USE_JUICE=1
-	<cxxflags>"`pkg-config --cflags openssl`"
 	<library>/libdatachannel//usrsctp
 	<library>/libdatachannel//juice
+	<library>/libdatachannel//plog
 	: # default build
 	<link>static
 	: # usage requirements
 	<include>./include
 	<library>/libdatachannel//plog
 	<cxxflags>-pthread
-	<linkflags>"`pkg-config --libs openssl`"
 	;
 
+feature crypto : openssl gnutls : composite propagated ;
+feature.compose <crypto>openssl
+    : <define>USE_GNUTLS=0 ;
+feature.compose <crypto>gnutls
+    : <define>USE_GNUTLS=1 ;
+
 alias plog
     : # no sources
     : # no build requirements
@@ -57,9 +64,21 @@ actions make_libusrsctp
 }
 
 make libjuice.a : : @make_libjuice ;
+
+rule make_libjuice ( targets * : sources * : properties * )
+{
+	if <crypto>gnutls in $(properties)
+	{
+		MAKEOPTS on $(targets) = "USE_NETTLE=1" ;
+	}
+	else
+	{
+		MAKEOPTS on $(targets) = "USE_NETTLE=0" ;
+	}
+}
 actions make_libjuice
 {
-	(cd $(CWD)/deps/libjuice && make USE_NETTLE=0)
+	(cd $(CWD)/deps/libjuice && make $(MAKEOPTS))
     cp $(CWD)/deps/libjuice/libjuice.a $(<)
 }