From be39a5d7e8b3615b3676f1960d4f8d89e92efd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sun, 16 Oct 2022 15:42:16 -0500 Subject: [PATCH] allow use config.def.h instead of config.h --- Makefile | 4 ++-- config.mk | 3 +++ dwl.c | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 21165ed..c4e5397 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ include config.mk # flags for compiling -DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND) -DWLDEVCFLAGS = -g -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\ +DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND) $(CONFIG_H) +DWLDEVCFLAGS = -ggdb3 -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\ -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types # CFLAGS / LDFLAGS diff --git a/config.mk b/config.mk index 4bc9b9d..078236a 100644 --- a/config.mk +++ b/config.mk @@ -8,6 +8,9 @@ PREFIX = /usr/local MANDIR = $(PREFIX)/share/man DATADIR = $(PREFIX)/share +# Comment to use config.h instead of config.def.h +CONFIG_H = -DUSE_CONFIG_DEF_H + XWAYLAND = XLIBS = # Uncomment to build XWayland support diff --git a/dwl.c b/dwl.c index 8cf9edf..01b76b9 100644 --- a/dwl.c +++ b/dwl.c @@ -455,7 +455,11 @@ static xcb_atom_t netatom[NetLast]; #endif /* configuration, allows nested code to access above variables */ -#include "config.h" +#ifdef USE_CONFIG_DEF_H +# include "config.def.h" +#else +# include "config.h" +#endif /* attempt to encapsulate suck into one file */ #include "client.h"