From 79e14749d5ba369bb4272acc2ddc4decd3a93657 Mon Sep 17 00:00:00 2001 From: Roman Lut <11955117+RomanLut@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:52:37 +0200 Subject: [PATCH] add option to build sitl with debug information --- cmake/docker_build_sitl.sh | 3 ++- cmake/sitl.cmake | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/docker_build_sitl.sh b/cmake/docker_build_sitl.sh index b1a4ada5c..a79742ae0 100644 --- a/cmake/docker_build_sitl.sh +++ b/cmake/docker_build_sitl.sh @@ -1,6 +1,7 @@ #!/bin/bash rm -r build_SITL mkdir -p build_SITL -cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -GNinja -B build_SITL .. +#cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -GNinja -B build_SITL .. +cmake -DSITL=ON -DDEBUG=ON -DWARNINGS_AS_ERRORS=ON -GNinja -B build_SITL .. cd build_SITL ninja \ No newline at end of file diff --git a/cmake/sitl.cmake b/cmake/sitl.cmake index 24a4ae9b2..78697f98a 100644 --- a/cmake/sitl.cmake +++ b/cmake/sitl.cmake @@ -53,6 +53,11 @@ set(SITL_COMPILE_OPTIONS -funsigned-char ) +if(DEBUG) + message(STATUS "Debug mode enabled. Adding -g to SITL_COMPILE_OPTIONS.") + list(APPEND SITL_COMPILE_OPTIONS -g) +endif() + if(NOT MACOSX) set(SITL_COMPILE_OPTIONS ${SITL_COMPILE_OPTIONS} -Wno-return-local-addr -- 2.11.4.GIT