2022-07-11 14:13:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2022-09-01 18:15:34 +00:00
|
|
|
# Usage: windows-configure.sh [rootdir [builddir]] -DWHATEVER=BLAH ...
|
|
|
|
|
|
|
|
if [ $# -ge 1 ] && [[ "$1" != -* ]]; then
|
|
|
|
root="$1"
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
root="$(dirname $0)"/..
|
|
|
|
fi
|
|
|
|
root="$(readlink -f "$root")"
|
|
|
|
|
|
|
|
if [ $# -ge 1 ] && [[ "$1" != -* ]]; then
|
|
|
|
build="$(readlink -f "$1")"
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
build="$root/build/win32"
|
|
|
|
echo "Setting up build in $build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$build"
|
2022-07-11 14:13:31 +00:00
|
|
|
cmake \
|
|
|
|
-S "$root" -B "$build" \
|
|
|
|
-G 'Unix Makefiles' \
|
|
|
|
-DCMAKE_EXE_LINKER_FLAGS=-fstack-protector \
|
|
|
|
-DCMAKE_CXX_FLAGS=-fdiagnostics-color=always \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="$root/contrib/cross/mingw64.cmake" \
|
2022-08-08 23:03:38 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2022-07-11 14:13:31 +00:00
|
|
|
-DBUILD_STATIC_DEPS=ON \
|
|
|
|
-DBUILD_PACKAGE=ON \
|
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
|
|
-DBUILD_TESTING=OFF \
|
|
|
|
-DBUILD_LIBLOKINET=OFF \
|
|
|
|
-DWITH_TESTS=OFF \
|
2022-08-29 14:24:04 +00:00
|
|
|
-DWITH_BOOTSTRAP=OFF \
|
2022-07-11 14:13:31 +00:00
|
|
|
-DNATIVE_BUILD=OFF \
|
|
|
|
-DSTATIC_LINK=ON \
|
|
|
|
-DWITH_SYSTEMD=OFF \
|
|
|
|
-DFORCE_OXENMQ_SUBMODULE=ON \
|
|
|
|
-DFORCE_OXENC_SUBMODULE=ON \
|
|
|
|
-DFORCE_FMT_SUBMODULE=ON \
|
|
|
|
-DFORCE_SPDLOG_SUBMODULE=ON \
|
|
|
|
-DFORCE_NLOHMANN_SUBMODULE=ON \
|
|
|
|
-DWITH_LTO=OFF \
|
2022-09-01 18:15:34 +00:00
|
|
|
"$@"
|