Skip to content

Commit bd783b1

Browse files
committed
Add debug option and flags to the Premake build and compile scripts.
1 parent 64b1efd commit bd783b1

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

build/Compile.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
set -e
33

44
CUR_DIR=$(cd "$(dirname "$0")"; pwd)
5+
DEBUG=false
6+
7+
for i in "$@"
8+
do
9+
case $i in
10+
-debug|--debug)
11+
DEBUG=true
12+
;;
13+
*)
14+
# unknown option
15+
;;
16+
esac
17+
done
518

619
if [ "$(uname)" == "Darwin" ]; then
720
PREMAKE=$CUR_DIR/premake5-osx;
@@ -25,6 +38,10 @@ fi
2538
export PATH=$PATH:$MONO_PATH
2639

2740
$PREMAKE --file=$CUR_DIR/premake5.lua gmake "$@"
41+
42+
if $DEBUG; then
43+
BUILD_CONF=debug_x64;
44+
fi
2845
config=$BUILD_CONF make -C $CUR_DIR/gmake/
2946

3047
BUILD_CONF_DIR="$(tr '[:lower:]' '[:upper:]' <<< ${BUILD_CONF:0:1})${BUILD_CONF:1}"

build/Helpers.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ newoption {
2525
description = "disable examples from being included"
2626
}
2727

28+
newoption {
29+
trigger = "debug",
30+
description = "enable debug mode"
31+
}
32+
2833
explicit_target_architecture = _OPTIONS["arch"]
2934

3035
function get_mono_path()

build/scripts/LLVM.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ function get_llvm_package_name(rev, conf, arch)
124124
end
125125

126126
function get_llvm_configuration_name(debug)
127+
debug = _OPTIONS["debug"]
127128
if debug == true then
128129
return "Debug"
129130
end

0 commit comments

Comments
 (0)