NixOS/nixpkgs — pull request #4762 by ambrop72 (2014-11-01 14:29:00+00:00)
Title: badvpn: Add debug flag to enable assertions.

This adds a "debug" flag to prevent NDEBUG from being passed, enabling assertions.

This works by setting the CMAKE_C_FLAGS to whatever we need them to be, while setting the CMAKE_BUILD_TYPE back to empty (set to Release by the default builder). Because otherwise -DNDEBUG would be added by cmake on top of our flags, nullifying the effect.

It would be nice to do this in a way that all cmake packages would have this functionality automatically, but right now I really need this.