allow use config.def.h instead of config.h

This commit is contained in:
Leonardo Hernández Hernández 2022-10-16 15:42:16 -05:00 committed by Leonardo Hernández Hernández
parent e5dc5b0ad7
commit be39a5d7e8
No known key found for this signature in database
GPG key ID: E538897EE11B9624
3 changed files with 10 additions and 3 deletions

View file

@ -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

View file

@ -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

6
dwl.c
View file

@ -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"