From 074341e421989919e9c412f141fe7f80e85238b6 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 13 Aug 2021 02:09:54 -0400 Subject: [PATCH] [host] windows/crash: do not report absolute paths on build machines This commit makes the crash handler show relative paths instead of absolute ones, which makes the stack traces generated easier to read. On the other hand, absolute paths makes sense on Linux, since the user is expected to build the binaries themselves, and gdb will be able to find the source code. --- host/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index ef6eade8..5eb7b72d 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -27,6 +27,10 @@ add_compile_options( ) set(CMAKE_C_STANDARD 11) +if(WIN32) + add_compile_options("-fdebug-prefix-map=${PROJECT_TOP}/=") +endif() + add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/version.c ${CMAKE_BINARY_DIR}/include/version.h