Skip to content

Commit

Permalink
Add a build option to disable easylogging's default crash handler (#246)
Browse files Browse the repository at this point in the history
* Add a build option to disable easylogging's default crash handler

* Add missing backslash to build script
  • Loading branch information
MichaelBuckley authored and Jason Gauci committed Nov 10, 2019
1 parent 24d35eb commit e03d9d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(POLICY CMP0058)
endif()

option(CODE_COVERAGE "Enable code coverage" OFF)
option(DISABLE_CRASH_LOG "Disable installing easylogging crash handler" OFF)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DET_VERSION='\"${PROJECT_VERSION}\"'")
# For easylogging, disable default log file, enable crash log, ensure thread safe, and catch c++ exceptions
Expand All @@ -21,6 +22,10 @@ IF(CODE_COVERAGE)
endif()
ENDIF(CODE_COVERAGE)

if(DISABLE_CRASH_LOG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DELPP_DISABLE_DEFAULT_CRASH_HANDLING")
ENDIF(DISABLE_CRASH_LOG)

if(UNIX)
# Enable C++-11
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
Expand Down
2 changes: 2 additions & 0 deletions build_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PROTO_LIB_DIR="$PWD/../deps/out/lib64"
else
PROTO_LIB_DIR="$PWD/../deps/out/lib"
fi
DISABLE_CRASH_LOG=${DISABLE_CRASH_LOG:-OFF}
cmake \
-DProtobuf_INCLUDE_DIR="$PWD"/../deps/out/include \
-DProtobuf_LIBRARY_DEBUG="$PROTO_LIB_DIR"/libprotobuf.a \
Expand All @@ -62,6 +63,7 @@ cmake \
-Dsodium_LIBRARY_RELEASE="$PWD"/../deps/out/lib/libsodium.a \
-Dsodium_USE_STATIC_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="$PWD"/../out \
-DDISABLE_CRASH_LOG="$DISABLE_CRASH_LOG" \
../
make -j8 install
cd ../out || exit
Expand Down

0 comments on commit e03d9d7

Please sign in to comment.