File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 6363 - platform : { name: Windows MinGW, os: windows-2022 }
6464 config : { name: Static Standard Libraries, flags: -GNinja -DSFML_USE_MESA3D=TRUE -DCMAKE_CXX_COMPILER=g++ -DSFML_USE_STATIC_STD_LIBS=TRUE }
6565 - platform : { name: Windows MinGW, os: windows-2022 }
66- config : { name: Static with PCH (GCC), flags: -GNinja -DSFML_USE_MESA3D=TRUE -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=FALSE -DSFML_ENABLE_PCH=1 }
66+ config : { name: Static with PCH (GCC), flags: -GNinja -DSFML_USE_MESA3D=TRUE -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=FALSE -DSFML_ENABLE_PCH=1 -DSFML_ENABLE_STDLIB_ASSERTIONS=FALSE } # disabling stdlib assertions due to false positive
6767 - platform : { name: macOS, os: macos-12 }
6868 config : { name: Frameworks, flags: -GNinja -DSFML_BUILD_FRAMEWORKS=TRUE -DBUILD_SHARED_LIBS=TRUE }
6969 - platform : { name: macOS , os: macos-12 }
Original file line number Diff line number Diff line change @@ -204,6 +204,13 @@ if(SFML_ENABLE_SANITIZERS)
204204 string (APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -fno-sanitize-recover=all -fsanitize=undefined" )
205205endif ()
206206
207+ option (SFML_ENABLE_STDLIB_ASSERTIONS "Enable standard library assertions" OFF )
208+ if (SFML_ENABLE_STDLIB_ASSERTIONS)
209+ # intentionally using `add_definitions` here to propagate defines to subdirectories
210+ add_definitions (-D_GLIBCXX_ASSERTIONS=1 ) # see https://gcc.gnu.org/wiki/LibstdcxxDebugMode
211+ add_definitions (-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE ) # see https://libcxx.llvm.org/Hardening.html
212+ endif ()
213+
207214# set the output directory for SFML DLLs and executables
208215set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} /bin)
209216
Original file line number Diff line number Diff line change 1010 "CMAKE_EXPORT_COMPILE_COMMANDS" : " ON" ,
1111 "SFML_BUILD_EXAMPLES" : " ON" ,
1212 "SFML_BUILD_TEST_SUITE" : " ON" ,
13+ "SFML_ENABLE_STDLIB_ASSERTIONS" : " ON" ,
1314 "SFML_WARNINGS_AS_ERRORS" : " ON"
1415 }
1516 }
You can’t perform that action at this time.
0 commit comments