Allow SFML to compile with exceptions disabled
Author: JoshuaVandaeleCreated Apr 23, 2026Updated Apr 23, 2026
Labelsfeature
Prerequisite Checklist
- I searched for existing issues to prevent duplicates
- I searched for existing discussions on the forum to prevent duplicates
- I understand SFML's scope and believe the feature fits it
Describe your feature request here
Certain libraries such as Qt and PugiXML have a PUGIXML_NO_EXCEPTIONS and QT_NO_EXCEPTIONS compile-time flag respectively, to allow their library to be compiled with the -fno-exceptions flag. I would like to see the same thing for SFML, with a SFML_NO_EXCEPTIONS flag.
Use Cases
I would like to be able to compile my application statically with SFML with exceptions disabled, without having to fall back to dirty CMake tricks to only allow exceptions for SFML.
API Example
set(SFML_NO_EXCEPTIONS ON CACHE BOOL "" FORCE)
add_subdirectory(SFML)Source: SFML/SFML