shithub: rgbds

Download patch

ref: 28737d5778f05bd554e595360c1f94d21328d15d
parent: 12ba057b4f74a6ef4989d0ceb4075ef74bcc6ea2
author: ISSOtm <eldredhabert0@gmail.com>
date: Tue Oct 11 17:43:37 EDT 2022

Enable GLIBCXX_ASSERTIONS in `make develop`

Not sure it's very portable, but this is only the dev config

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,7 @@
                   -fsanitize=alignment -fsanitize=null -fsanitize=address)
     add_compile_options(${SAN_FLAGS})
     add_link_options(${SAN_FLAGS})
+    add_definitions(-D_GLIBCXX_ASSERTIONS)
     # A non-zero optimization level is desired in debug mode, but allow overriding it nonetheless
     # TODO: this overrides anything previously set... that's a bit sloppy!
     set(CMAKE_C_FLAGS_DEBUG "-g -Og -fno-omit-frame-pointer -fno-optimize-sibling-calls" CACHE STRING "" FORCE)
--- a/Makefile
+++ b/Makefile
@@ -234,6 +234,7 @@
 		-Wno-type-limits -Wno-tautological-constant-out-of-range-compare \
 		-Wvla \
 		-Wno-unknown-warning-option \
+		-D_GLIBCXX_ASSERTIONS \
 		-fsanitize=shift -fsanitize=integer-divide-by-zero \
 		-fsanitize=unreachable -fsanitize=vla-bound \
 		-fsanitize=signed-integer-overflow -fsanitize=bounds \