1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-28 18:17:11 -07:00

do debug builds by default

This commit is contained in:
Connor Olding 2017-05-17 20:27:17 +00:00
parent 341b7613cc
commit b63f1ba653

View File

@ -74,12 +74,12 @@ compile() {
sep_once=1 sep_once=1
} }
if [ $# -lt 2 ]; then if [ $# -eq 0 ]; then
echo -n "usage: compile [" >&2 echo -n "usage: compile [" >&2
[ -n "$clang" ] && print_separated "clang" [ -n "$clang" ] && print_separated "clang"
[ -n "$gcc" ] && print_separated "gcc" [ -n "$gcc" ] && print_separated "gcc"
[ -n "$cl" ] && print_separated "cl" [ -n "$cl" ] && print_separated "cl"
echo "] {debug|derelease|release|hardened} [flags...] {source file}" >&2 echo "] [debug|derelease|release|hardened] [flags...] {source file}" >&2
return 1 return 1
fi fi
@ -91,9 +91,9 @@ compile() {
local file=${@[-1]} local file=${@[-1]}
[ "${file##*.}" = "c" ] || [ "${file##*.}" = "h" ] || sepples=1 [ "${file##*.}" = "c" ] || [ "${file##*.}" = "h" ] || sepples=1
{ [ $1 = clang ] && CC="clang" && CXX="clang++" && shift } || \ { [ "$1" = clang ] && CC="clang" && CXX="clang++" && shift } || \
{ [ $1 = gcc ] && CC="gcc" && CXX="g++" && shift } || \ { [ "$1" = gcc ] && CC="gcc" && CXX="g++" && shift } || \
{ [ $1 = msvc ] && CC="cl" && CXX="cl" && shift } { [ "$1" = msvc ] && CC="cl" && CXX="cl" && shift }
maybe_include() { maybe_include() {
[ -d "$1" ] && our_flags+=("-I$1") [ -d "$1" ] && our_flags+=("-I$1")
@ -163,11 +163,11 @@ compile() {
fi fi
fi fi
{ [ $1 = debug ] && our_flags+=($debug_flags) && shift } || \ { [ "$1" = debug ] && our_flags+=($debug_flags) && shift } || \
{ [ $1 = release ] && our_flags+=($release_flags) && shift } || \ { [ "$1" = release ] && our_flags+=($release_flags) && shift } || \
{ [ $1 = derelease ] && our_flags+=($dr_flags) && shift } || \ { [ "$1" = derelease ] && our_flags+=($dr_flags) && shift } || \
{ [ $1 = hardened ] && our_flags+=($hardened_flags) && shift } || \ { [ "$1" = hardened ] && our_flags+=($hardened_flags) && shift } || \
{ echo "please specify either debug or (de)release or hardened" >&2; return 1 } { our_flags+=($debug_flags) } # our default
# TODO add static option # TODO add static option