nsxiv657080a
config.mk: default to `-O2` and `-DNDEBUG` (#435)
assertions are for debugging purposes, and so shouldn't be enabled for "release" builds. disable it by default by using `-DNDEBUG`. `-O2` on gcc/clang will result it slightly better binary. on tcc it'll be ignored. and since -O is specified by POSIX there shouldn't be any portability concern. additionally add a (commented out) recommended debug build for gcc/clang with address and undefined sanitizers turned on.
+5 −2
1 file changed
- M config.mk +5 −2
| @@ -23,8 +23,11 @@ HAVE_LIBWEBP = $(OPT_DEP_DEFAULT) | |||
| 23 | 23 | ||
| 24 | 24 | # Compiler and linker | |
| 25 | 25 | CC = c99 | |
| 26 | − | # CFLAGS, any optimization flags goes here | |
| 27 | − | CFLAGS = -Wall -pedantic | |
| 26 | + | # CFLAGS, any additional compiler flags goes here | |
| 27 | + | CFLAGS = -Wall -pedantic -O2 -DNDEBUG | |
| 28 | + | # Uncomment for a debug build using gcc/clang | |
| 29 | + | # CFLAGS = -Wall -pedantic -g3 -fsanitize=address,undefined | |
| 30 | + | # LDFLAGS = $(CFLAGS) | |
| 28 | 31 | ||
| 29 | 32 | # icons that will be installed via `make icon` | |
| 30 | 33 | ICONS = 16x16.png 32x32.png 48x48.png 64x64.png 128x128.png | |