There's a merged pull request on the void-packages repository Add -DNDEBUG to CFLAGS and CXXFLAGS in CMake build style https://github.com/void-linux/void-packages/pull/31990 Description: CMake adds `-DNDEBUG` with build types `Release`, `MinSizeRel` and `RelWithDebInfo` (see https://github.com/Kitware/CMake/blob/master/Modules/Compiler/GNU.cmake#L57). `NDEBUG` disables `assert()`, which can improve performance.