From 4955e01ef28ae89cdff24915dd897417e06625ff Mon Sep 17 00:00:00 2001 From: Adriankhl Date: Mon, 6 Mar 2023 10:00:04 +0100 Subject: [PATCH] Fix lldb string inspection for debug build --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f27c9755a..84fe7a797 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,7 +300,7 @@ if(ANDROID) list(APPEND SYSTEM_LIBS log) endif() -if(CMAKE_COMPILER_IS_GNUCXX OR NOT WIN32) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized") @@ -320,6 +320,12 @@ if(CMAKE_COMPILER_IS_GNUCXX OR NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds") # false positives in boost::multiarray during release build, keep as warning-only endif() + # Fix string inspection with lldb + # https://stackoverflow.com/questions/58578615/cannot-inspect-a-stdstring-variable-in-lldb + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstandalone-debug") + endif() + if(UNIX) set(SYSTEM_LIBS ${SYSTEM_LIBS} ${CMAKE_DL_LIBS}) endif()