Skip to content

Commit

Permalink
Add debug/release in build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
yizhang82 committed Dec 30, 2017
1 parent 60aefc4 commit 45de705
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,3 +7,4 @@
*.bak
dep
.user
bin
34 changes: 33 additions & 1 deletion build.sh
@@ -1,9 +1,41 @@
#!/bin/sh

BUILD_DEBUG=0

# Parsing arguments
while [[ $# -gt 0 ]]
do
key="$1"

case $key in
-d|--debug)
BUILD_DEBUG=1
shift # past argument
shift # past value
;;
-r|--release)
BUILD_DEBUG=0
shift # past argument
shift # past value
;;
*) # unknown option
shift # past argument
;;
esac
done

if [ ! -d "bin" ]; then
mkdir bin
fi
cmake bin
pushd bin > /dev/null
if [[ "$BUILD_DEBUG" -eq 1 ]]; then
echo Building Debug...
cmake -DCMAKE_BUILD_TYPE=Debug ..
else
echo Building Release...
cmake -DCMAKE_BUILD_TYPE=Release ..
fi
cmake ..
make || exit
popd > /dev/null
pushd test > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion test/cpu_test.cpp
Expand Up @@ -83,7 +83,7 @@ TEST_CASE("CPU tests") {
}
#define INSTR_V5_TEST_CASE(test) \
SUBCASE("instr_test-v5 " test) { \
INIT_TRACE("neschan.instrtest.instr_test-v5." test "log"); \
INIT_TRACE("neschan.instrtest.instr_test-v5." test ".log"); \
cout << "Running [CPU][instr_test-v5-" << test << "]" << endl; \
system.power_on(); \
auto cpu = system.cpu(); \
Expand Down

0 comments on commit 45de705

Please sign in to comment.