Skip to content

Commit

Permalink
add some utility scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
BigPeet committed Mar 18, 2021
1 parent e700a95 commit 7f9059f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ if [[ ! -d ./build ]]; then
mkdir build
fi

if [[ $1 == "default" ]]; then
DEFAULT_CMAKE_ARGS="-DENABLE_TESTING=ON -DENABLE_IWYU=ON -DCMAKE_INSTALL_PREFIX=../install"
shift
else
DEFAULT_CMAKE_ARGS=""
fi

# Note:
# Set CMAKE_PREFIX_PATH to find packages/programs, like IWYU.
# Set CMAKE_INSTALL_PREFIX to change where targets are installed.
cd build
cmake .. $@
cmake .. $DEFAULT_CMAKE_ARGS $@
cmake --build .
cmake --install .
cd ..

if [[ ! -f compile_commands.json ]]; then
Expand Down
7 changes: 7 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ -d ./build ]]; then
cd build
ctest . $@
cd ..
fi

0 comments on commit 7f9059f

Please sign in to comment.