Added MSVC support to Jamfile

This commit is contained in:
Paul-Louis Ageneau
2020-06-20 15:54:26 +02:00
parent b569e78c02
commit d8ab5b4820

63
Jamfile
View File

@ -45,7 +45,16 @@ alias usrsctp
: # no default build : # no default build
: # usage requirements : # usage requirements
<include>./deps/usrsctp/usrsctplib <include>./deps/usrsctp/usrsctplib
<library>libusrsctp.a <library>libusrsctp.a
;
alias usrsctp
: # no sources
: <toolset>msvc
: # no default build
: # usage requirements
<include>./deps/usrsctp/usrsctplib
<library>libusrsctp.lib
; ;
alias juice alias juice
@ -54,32 +63,72 @@ alias juice
: # no default build : # no default build
: # usage requirements : # usage requirements
<include>./deps/libjuice/include <include>./deps/libjuice/include
<library>libjuice.a <library>libjuice-static.a
;
alias juice
: # no sources
: <toolset>msvc
: # no default build
: # usage requirements
<include>./deps/libjuice/include
<library>libjuice-static.lib
; ;
make libusrsctp.a : : @make_libusrsctp ; make libusrsctp.a : : @make_libusrsctp ;
make libusrsctp.lib : : @make_libusrsctp_msvc ;
actions make_libusrsctp actions make_libusrsctp
{ {
(cd $(CWD)/deps/usrsctp && cmake -B build -D CMAKE_C_FLAGS="-fPIC" && cd build && make -j2 usrsctplib-static) (cd $(CWD)/deps/usrsctp \
&& cmake -B build -D CMAKE_C_FLAGS="-fPIC" \
&& cd build && make -j2 usrsctplib-static)
cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.a $(<) cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.a $(<)
} }
actions make_libusrsctp_msvc
{
(cd $(CWD)/deps/usrsctp \
&& cmake -B build -G "NMake Makefiles" \
&& cd build && nmake usrsctplib-static)
cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.lib $(<)
}
make libjuice.a : : @make_libjuice ; make libjuice-static.a : : @make_libjuice ;
make libjuice-static.lib : : @make_libjuice_msvc ;
rule make_libjuice ( targets * : sources * : properties * ) rule make_libjuice ( targets * : sources * : properties * )
{ {
if <crypto>gnutls in $(properties) if <crypto>gnutls in $(properties)
{ {
MAKEOPTS on $(targets) = "USE_NETTLE=1" ; CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ;
} }
else else
{ {
MAKEOPTS on $(targets) = "USE_NETTLE=0" ; CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ;
} }
} }
actions make_libjuice actions make_libjuice
{ {
(cd $(CWD)/deps/libjuice && cmake -B build -D CMAKE_C_FLAGS="-fPIC" && cd build && make -j2 juice-static) (cd $(CWD)/deps/libjuice && cmake -B build -D CMAKE_C_FLAGS="-fPIC" $(CMAKEOPTS) \
&& cd build && make -j2 juice-static)
cp $(CWD)/deps/libjuice/build/libjuice-static.a $(<) cp $(CWD)/deps/libjuice/build/libjuice-static.a $(<)
} }
rule make_libjuice_msvc ( targets * : sources * : properties * )
{
if <crypto>gnutls in $(properties)
{
CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ;
}
else
{
CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ;
}
}
actions make_libjuice_msvc
{
(cd $(CWD)/deps/libjuice \
&& cmake -B build -D CMAKE_C_FLAGS="-fPIC" $(CMAKEOPTS) \
&& cd build && make -j2 juice-static)
cp $(CWD)/deps/libjuice/build/libjuice-static.lib $(<)
}