mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 09:34:00 +02:00
40 lines
747 B
Bash
Executable File
40 lines
747 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
script_dir="$(dirname "$0")"
|
|
toplvl_dir="$(realpath "$script_dir/../../")"
|
|
build_config="${1:-Debug}"
|
|
build_dir="$toplvl_dir/Build/$build_config"
|
|
install_dir="$toplvl_dir/Bin/$build_config"
|
|
threads="${2:-$(nproc)}"
|
|
|
|
generator="Unix Makefiles"
|
|
msys2="0"
|
|
|
|
if [ "$1" = "--help" ] ||
|
|
[ "$1" = "-h" ]
|
|
then
|
|
echo "$0 [Build Config] [Thread Count]"
|
|
exit
|
|
fi
|
|
|
|
mkdir -p "$build_dir"
|
|
|
|
pushd "$build_dir"
|
|
|
|
if [[ $(uname -s) = *MINGW64* ]]
|
|
then
|
|
msys2="1"
|
|
generator="MSYS Makefiles"
|
|
fi
|
|
|
|
cmake -S "$toplvl_dir" -B "$build_dir" -DCMAKE_BUILD_TYPE="$build_config" -DPORTABLE_INSTALL=ON -G "$generator"
|
|
|
|
make install DESTDIR="$toplvl_dir" -j$threads
|
|
|
|
if [[ "$msys2" = "1" ]]
|
|
then
|
|
make bundle_dependencies
|
|
fi
|
|
|
|
popd
|