mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator
synced 2025-05-23 21:57:40 +08:00
Make seperate debug and release build scripts. Strip the release build. Add missing define flags. Fix shared lib arg for libasan.
28 lines
1.5 KiB
Bash
28 lines
1.5 KiB
Bash
#!/bin/bash
|
|
if [ ! -d "${PWD}/release" ]; then
|
|
mkdir "${PWD}/release"
|
|
fi
|
|
if [ ! -d "${PWD}/release/experimental" ]; then
|
|
mkdir "${PWD}/release/experimental"
|
|
fi
|
|
if [ ! -d "${PWD}/release/lobby_connect" ]; then
|
|
mkdir "${PWD}/release/lobby_connect"
|
|
fi
|
|
protoc -I"${PWD}/dll/" --cpp_out="${PWD}/dll/" "${PWD}"/dll/*.proto
|
|
rm -rf "${PWD}/release/experimental"/*
|
|
pushd "${PWD}/release/experimental" >/dev/null
|
|
echo "Building release libsteam_api.so...."
|
|
clang++ -DNDEBUG=1 -DEMU_RELEASE_BUILD=1 -shared -fPIC -o libsteam_api.so ../../dll/*.cpp ../../dll/*.cc -g3 -Wno-return-type -fsanitize=address -shared-libasan -lprotobuf-lite -std=c++14 && echo built libsteam_api.so
|
|
cp libsteam_api.so libsteam_api.so.dbg
|
|
strip --enable-deterministic-archives --strip-unneeded --remove-section=.comment --remove-section=.note libsteam_api.so
|
|
objcopy --add-gnu-debuglink=libsteam_api.so.dbg libsteam_api.so
|
|
popd >/dev/null
|
|
rm -rf "${PWD}/release/lobby_connect"/*
|
|
pushd "${PWD}/release/lobby_connect" >/dev/null
|
|
echo "Building release lobby_connect...."
|
|
clang++ -DNO_DISK_WRITES=1 -DLOBBY_CONNECT=1 -DNDEBUG=1 -DEMU_RELEASE_BUILD=1 -fPIC -o lobby_connect ../../lobby_connect.cpp ../../dll/*.cpp ../../dll/*.cc -g3 -Wno-return-type -fsanitize=address -shared-libasan -lprotobuf-lite -std=c++14 && echo built lobby_connect
|
|
cp lobby_connect lobby_connect.dbg
|
|
strip --enable-deterministic-archives --strip-unneeded --remove-section=.comment --remove-section=.note lobby_connect
|
|
objcopy --add-gnu-debuglink=lobby_connect.dbg lobby_connect
|
|
popd >/dev/null
|