optional stack trace support
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2024-07-26 09:23:21 -05:00
parent 68a5f90715
commit 8aba39c955
3 changed files with 32 additions and 25 deletions

View File

@ -31,6 +31,8 @@ dcmake_cxx_flags
dcpphttplib_openssl_support
dcpphttplib_tcp_nodelay
dcpptrace_static_define
dcpptrace_unwind_with_execinfo
dcpptrace_unwind_with_libunwind
dcurl_ca_bundle
dcurl_ca_fallback
dcurl_disable_ldap
@ -67,6 +69,7 @@ drocksdb_install_on_windows
dshared
dspdlog_fmt_external
dthreads_prefer_pthread_flag
dunw_local_only
duse_libidn2
duuid_build_tests
dwith_benchmark

View File

@ -1,28 +1,29 @@
add_definitions(-DCPPTRACE_STATIC_DEFINE)
if (NOT PROJECT_STATIC_LINK)
if(PROJECT_IS_MINGW)
add_definitions(-DCPPTRACE_UNWIND_WITH_DBGHELP)
else()
add_definitions(-DCPPTRACE_UNWIND_WITH_UNWIND)
endif()
if(PROJECT_IS_MINGW)
add_definitions(-DCPPTRACE_UNWIND_WITH_DBGHELP)
else()
add_definitions(-DCPPTRACE_UNWIND_WITH_LIBUNWIND)
endif()
include(FetchContent)
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG v0.6.3
)
FetchContent_MakeAvailable(cpptrace)
link_libraries(cpptrace::cpptrace)
if(WIN32)
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace::cpptrace>
$<TARGET_FILE_DIR:your_target>
include(FetchContent)
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG v0.6.3
)
FetchContent_MakeAvailable(cpptrace)
if(WIN32)
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:cpptrace::cpptrace>
$<TARGET_FILE_DIR:your_target>
)
endif()
link_libraries(cpptrace::cpptrace)
endif()
set(CMAKE_CXX_FLAGS "-include common.hpp ${CMAKE_CXX_FLAGS}")

View File

@ -19,7 +19,9 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#if !defined(PROJECT_STATIC_LINK)
#include "cpptrace/cpptrace.hpp"
#endif
#include "cli/actions.hpp"
#include "initialize.hpp"
@ -30,7 +32,10 @@
using namespace repertory;
auto main(int argc, char **argv) -> int {
#if !defined(PROJECT_STATIC_LINK)
cpptrace::register_terminate_handler();
#endif
if (not repertory::project_initialize()) {
return -1;
}
@ -114,8 +119,6 @@ auto main(int argc, char **argv) -> int {
}
}
throw std::runtime_error("test");
int mount_result{};
if (res == exit_code::success) {
if (utils::cli::has_option(args, utils::cli::options::help_option)) {