Compare commits

...

2 Commits

Author SHA1 Message Date
BodgeMaster 2609342198 Build system: Make things (kinda) work on Windows
This will need additional work, I just cba to do it as it’s irrelevant rn
2023-01-16 04:58:30 +01:00
BodgeMaster cac0fd47ef README: Add Windows branch disclaimer 2023-01-16 04:55:10 +01:00
3 changed files with 18 additions and 27 deletions

View File

@ -1,3 +1,13 @@
# WARNING: This is the Windows branch.
- Do NOT work on this branch. It is intended for building only.
- Do NOT merge back to master. This branch contains changes that would break the master branch.
- Original commits on this branch should only ever be made regarding fixes
to the build system or otherwise necessary changes to get FOSS-VG to build
and run on Windows.
- This branch will only be maintained as needed.
# FOSS-VG (FOSS Voxel Generator)
This is a WIP Minecraft clone.

View File

@ -92,23 +92,10 @@ echo "done"
echo ">>> Building sockpp... "
pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
echo "Adding Cygwin workaound for building sockpp."
for FILE in "$(find ./ -type f)"; do
sed -i -e 's/_WIN32/PLEASE_DO_NOT_DEFINE_THIS_MACRO/g' $FILE
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
cmake -G "MinGW Makefiles" -Bbuild .
cmake --build build
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
cmake -Bbuild .
cmake --build build
fi
popd >/dev/null 2>&1
echo ">>> Cleaning up..."

View File

@ -13,7 +13,7 @@
# version 3 along with this program.
# If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
echo ">>> Loading shell environment for FOSS-VG development..."
echo ">>> Loading Windows-specific shell environment for FOSS-VG development..."
export PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
echo "Project base directory is $PROJECT_BASE_DIR"
@ -42,18 +42,12 @@ function build {
echo "Added aliases and functions."
export PATH="$PROJECT_BASE_DIR/bin:$PROJECT_BASE_DIR/bin/tools:$PROJECT_BASE_DIR/scripts/tools:$PATH"
if uname -s | tr [:upper:] [:lower:] | grep cygwin >/dev/null; then
echo "Adding Cygwin workaound for library path."
export PATH="$PROJECT_BASE_DIR/bin/lib:$PATH"
fi
echo "PATH is $PATH"
if [ -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib
else
export LD_LIBRARY_PATH="$PROJECT_BASE_DIR"/bin/lib:"$LD_LIBRARY_PATH"
fi
echo "LD_LIBRARY_PATH is $LD_LIBRARY_PATH"
# Windows workaround:
# Windows doesn't have LD_LIBRARY_PATH and searches for libraries on PATH instead.
export PATH="$PROJECT_BASE_DIR/bin/lib:$PATH"
echo "PATH is $PATH"
echo ">>> Checking for dependencies..."
MISSING_DEPS=0