diff --git a/CMakeLists.txt b/CMakeLists.txt index c0190c0..6488376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ add_test( ) #-- spectator library -add_library(spectator +add_library(spectator SHARED "spectator/logger.cc" "spectator/publisher.cc" "spectator/config.h" diff --git a/build.sh b/build.sh index fcedf35..af7998f 100755 --- a/build.sh +++ b/build.sh @@ -4,16 +4,21 @@ set -e # usage: ./build.sh [clean|clean --confirm|skiptest] -BUILD_DIR=cmake-build -# Choose: Debug, Release, RelWithDebInfo and MinSizeRel. Use Debug for asan checking locally. -BUILD_TYPE=Debug +if [[ -z "$BUILD_DIR" ]]; then + BUILD_DIR="cmake-build" +fi + +if [[ -z "$BUILD_TYPE" ]]; then + # Choose: Debug, Release, RelWithDebInfo and MinSizeRel. Use Debug for asan checking locally. + BUILD_TYPE="Debug" +fi BLUE="\033[0;34m" NC="\033[0m" if [[ "$1" == "clean" ]]; then echo -e "${BLUE}==== clean ====${NC}" - rm -rf $BUILD_DIR + rm -rf "$BUILD_DIR" rm -f spectator/*.inc if [[ "$2" == "--confirm" ]]; then # remove all packages from the conan cache, to allow swapping between Release/Debug builds @@ -22,8 +27,10 @@ if [[ "$1" == "clean" ]]; then fi if [[ "$OSTYPE" == "linux-gnu"* ]]; then - export CC=gcc-13 - export CXX=g++-13 + if [[ -z "$CC" || -z "$CXX" ]]; then + export CC=gcc-13 + export CXX=g++-13 + fi fi if [[ ! -f "$HOME/.conan2/profiles/default" ]]; then