From f725ca5daf80aa6c8009d5d6c6a2f684c3872d34 Mon Sep 17 00:00:00 2001 From: nikp123 Date: Fri, 12 Jul 2024 16:40:26 +0200 Subject: [PATCH] bugfix: link the directory so that GDB is able to read the relevant source code --- src/cmake/os-prerequisites.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmake/os-prerequisites.cmake b/src/cmake/os-prerequisites.cmake index 2820fb8..b1bb822 100644 --- a/src/cmake/os-prerequisites.cmake +++ b/src/cmake/os-prerequisites.cmake @@ -42,7 +42,10 @@ else() # See: https://stackoverflow.com/a/16658858 # # Needed for achieving purity in a nix build - add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}/=/) + # + # Assume we're running this from the ./build directory + # so that GDB picks up our source files when debugging + add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}/=../) if(GNU) set(BUILD_DEBUG_FLAGS "-rdynamic")