From 9a20248a5b6b788c68c877e64b7b716430e92e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jianxiang=20Wang=20=28=E7=8E=8B=E5=81=A5=E7=BF=94=29?= Date: Fri, 31 Mar 2023 10:44:59 +0800 Subject: [PATCH] Enable -g1 in CMake release build to produce source and line number in stack trace (#64705) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2f8e71b68f2..f08f441b1615 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,11 +294,11 @@ if (NOT MSVC) if (NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Windows") set(CATA_WARNINGS "${CATA_WARNINGS} -Wredundant-decls") endif () - set(CATA_OTHER_FLAGS "${CATA_OTHER_FLAGS} -fsigned-char") + set(CATA_OTHER_FLAGS "${CATA_OTHER_FLAGS} -fsigned-char -g1") # Compact the whitespace in the warning string string(REGEX REPLACE "[\t ]+" " " CATA_WARNINGS "${CATA_WARNINGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS} ${CATA_OTHER_FLAGS}") - set(CMAKE_CXX_FLAGS_DEBUG "-Og -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Og -g2") endif () set(CMAKE_CXX_STANDARD 17)