File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
116116find_package (Threads REQUIRED)
117117include (CheckCXXCompilerFlag)
118118
119+ # enable libstdc++ assertions for debug builds
120+ if (CMAKE_SYSTEM_NAME MATCHES "Linux" )
121+ add_compile_definitions ($<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS>)
122+ endif ()
123+
119124if (NOT MSVC )
120125 if (LLAMA_SANITIZE_THREAD)
121126 add_compile_options (-fsanitize=thread)
Original file line number Diff line number Diff line change @@ -174,6 +174,10 @@ ifdef LLAMA_DEBUG
174174 MK_CFLAGS += -O0 -g
175175 MK_CXXFLAGS += -O0 -g
176176 MK_LDFLAGS += -g
177+
178+ ifeq ($(UNAME_S),Linux)
179+ MK_CXXFLAGS += -Wp,-D_GLIBCXX_ASSERTIONS
180+ endif
177181else
178182 MK_CPPFLAGS += -DNDEBUG
179183endif
You can’t perform that action at this time.
0 commit comments