-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildwin.sh
executable file
·47 lines (35 loc) · 979 Bytes
/
buildwin.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
export VCPKG_INSTALLED_DIR=$(pwd)/build/vcpkg_installed
shouldRun=false
# Main loop for argument parsing
while [[ "$#" -gt 0 ]]; do
case $1 in
-r|--run)
shouldRun=true
;;
esac
shift
done
source ./scripts/project_vars.sh
# Check for required environment variables
if [ -z "$PROJECT_SETUP_COMPLETE" ]; then
source ./scripts/windows/init_vcpkg.sh
fi
BASEDIR=$(dirname "$0") # Get script location.
printf "Switching to build directory: \"$BASEDIR/build\"\n"
if [ ! -d "$BASEDIR/build" ]; then
mkdir "$BASEDIR/build"
fi
cd "$BASEDIR\build"
printf "Running cmake:\n"
export TARGET_ARCH=x64
cmake .. -A $TARGET_ARCH -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE"
#CONFIGURATION="Debug"
printf "Building program:\n"
cmake --build . --config Debug
if [ "$shouldRun" = true ]; then
printf "Running application:\n"
cd ./bin/Debug
./SkyForgeEngine.exe
fi
printf "Switching back to working directory\n"
cd "$BASEDIR"