forked from shinyquagsire23/OpenJKDF2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_run_openmots_macos.sh
executable file
·71 lines (59 loc) · 3.98 KB
/
build_run_openmots_macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/zsh
export PATH="${HOMEBREW_PREFIX}/opt/llvm/bin:$PATH"
export MACOSX_DEPLOYMENT_TARGET=10.15
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
cd /Users/maxamillion/workspace/OpenJKDF2/
export OPENJKDF2_RELEASE_COMMIT=$(git log -1 --format="%H")
export OPENJKDF2_RELEASE_COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
#make flex/flex
#make byacc/yacc
#cp DF2/player_bak/Max/Max.plr ~/.local/share/openjkdf2/player/Max/Max.plr
#OPENJKDF2_NO_ASAN=1 DEBUG_QOL_CHEATS=1 make -f Makefile.macos -j10 &&
mkdir -p build_darwin64 && cd build_darwin64
if [ ! -f build_protoc/protoc ]; then
mkdir -p build_protoc && cd build_protoc
cmake -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF ../../3rdparty/protobuf/cmake
make -j10 protoc
cd ..
fi
if [ ! -f build_protobuf/libprotobuf.dylib ]; then
mkdir -p build_protobuf && cd build_protobuf
cmake -DCMAKE_INSTALL_PREFIX=. -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=ON ../../3rdparty/protobuf/cmake
make -j10 install
cd ..
fi
if [ ! -f build_gns/bin/libGameNetworkingSockets.dylib ]; then
mkdir -p build_gns && cd build_gns
GNS_BUILD=$(pwd)
export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
cmake -DCMAKE_BUILD_TYPE=Release -DProtobuf_USE_STATIC_LIBS=ON -DProtobuf_LIBRARIES="-L$GNS_BUILD/../build_protobuf/lib" -DProtobuf_LIBRARIES_PATH="$GNS_BUILD/../build_protobuf/lib" -DProtobuf_INCLUDE_DIR=$GNS_BUILD/../../3rdparty/protobuf/src -DProtobuf_INCLUDE_DIR2=$GNS_BUILD/../build_protobuf/include -DProtobuf_PROTOC_EXECUTABLE=$GNS_BUILD/../build_protoc/protoc $GNS_BUILD/../../3rdparty/GameNetworkingSockets
make -j10
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD
cd ..
fi
if [ ! -f build_physfs/libphysfs.a ]; then
mkdir -p build_physfs && cd build_physfs
PHYSFS_BUILD=$(pwd)
cmake -DCMAKE_BUILD_TYPE=Release -DPHYSFS_ARCHIVE_GRP=FALSE -DPHYSFS_ARCHIVE_WAD=FALSE -DPHYSFS_ARCHIVE_HOG=FALSE -DPHYSFS_ARCHIVE_MVL=FALSE -DPHYSFS_ARCHIVE_QPAK=FALSE -DPHYSFS_ARCHIVE_SLB=FALSE -DPHYSFS_ARCHIVE_VDF=FALSE $PHYSFS_BUILD/../../3rdparty/physfs
make -j10
cd ..
fi
export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@1.1/lib/pkgconfig
DEBUG_QOL_CHEATS=0 OPENJKDF2_NO_ASAN=0 cmake .. &&
DEBUG_QOL_CHEATS=0 OPENJKDF2_NO_ASAN=0 make -j10 &&
cd .. &&
#cp resource/shaders/* DF2/resource/shaders/ &&
mkdir -p "/Users/maxamillion/Library/Application Support/OpenJKDF2/openjkmots/resource/shaders/" &&
cp resource/shaders/* "/Users/maxamillion/Library/Application Support/OpenJKDF2/openjkmots/resource/shaders/" &&
echo "Running..." &&
#codesign -s - openjkdf2-64 &&
#OPENJKMOTS_ROOT="~/Library/Application Support/OpenJKDF2/openjkmots" LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -motsCompat #-- -verboseNetworking
#OPENJKDF2_ROOT="~/Library/Application Support/OpenJKDF2/openjkmots" LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 #-- -verboseNetworking
#lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -motsCompat -path research #-- -verboseNetworking
LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log detect_leaks=0" lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64 -- -motsCompat #-- -verboseNetworking
#lldb -o run ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64
#open OpenJKDF2.app
#LSAN_OPTIONS="suppressions=/Users/maxamillion/workspace/OpenJKDF2/suppr.txt" ASAN_OPTIONS="detect_leaks=1:log_path=/Users/maxamillion/workspace/OpenJKDF2/asan.log" ./OpenJKDF2.app/Contents/MacOS/openjkdf2-64