setup_project: Build sockpp on Windows
This still has its issues but at least it's reasonable to assume that the built library works. Now, it's a question of figuring out how to link against it because I haven't gotten that to work yet.cygwin
parent
f7a6bdd119
commit
ca150d0f05
|
@ -95,18 +95,10 @@ pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1
|
||||||
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
|
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
|
||||||
echo "Adding Cygwin workaound for building sockpp."
|
echo "Adding Cygwin workaound for building sockpp."
|
||||||
|
|
||||||
for FILE in "$(find ./ -type f)"; do
|
PATH=$(echo $PATH | sed 's/:/\n/g' | grep cygdrive | tr '\n' ':') cmake -G "MinGW Makefiles" -DSOCKPP_BUILD_SHARED=ON -DSOCKPP_BUILD_STATIC=OFF -B build .
|
||||||
sed -i -e 's/_WIN32/PLEASE_DO_NOT_DEFINE_THIS_MACRO/g' $FILE
|
PATH=$(echo $PATH | sed 's/:/\n/g' | grep cygdrive | tr '\n' ':') cmake --build build
|
||||||
done
|
|
||||||
mv ./include/sockpp/socket.h ./include/sockpp/socket.h_original
|
|
||||||
echo '#include <sys/time.h>
|
|
||||||
#include "socket.h_original"' > ./include/sockpp/socket.h
|
|
||||||
sed -i -e 's/SO_REUSEPORT/SO_REUSEADDR/g' ./src/acceptor.cpp
|
|
||||||
|
|
||||||
CFLAGS="-D_XOPEN_SOURCE=700" CXXFLAGS="-D_XOPEN_SOURCE=700" cmake -Bbuild
|
|
||||||
CFLAGS="-D_XOPEN_SOURCE=700" CXXFLAGS="-D_XOPEN_SOURCE=700" cmake --build build
|
|
||||||
else
|
else
|
||||||
cmake -Bbuild .
|
cmake -B build .
|
||||||
cmake --build build
|
cmake --build build
|
||||||
fi
|
fi
|
||||||
popd >/dev/null 2>&1
|
popd >/dev/null 2>&1
|
||||||
|
|
Loading…
Reference in New Issue