From 1d3ae53c60f2d0ce6683313fd09c34b71a6d6530 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 30 Apr 2022 02:02:08 +0200 Subject: [PATCH] Add support for compilation modes --- project.conf | 7 +++++++ src/lib/project.conf | 11 +++++++++-- src/project.conf | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/project.conf b/project.conf index 2b5ce47..83601b3 100644 --- a/project.conf +++ b/project.conf @@ -6,6 +6,13 @@ subdirs=data,doc,include,src,tests targets=tests dist=Makefile,COPYING,config.h,config.sh +#modes +[mode::debug] +title=Debug + +[mode::release] +title=Release + #targets [tests] type=command diff --git a/src/lib/project.conf b/src/lib/project.conf index c4d0abb..5a5c5c8 100644 --- a/src/lib/project.conf +++ b/src/lib/project.conf @@ -1,12 +1,19 @@ targets=libcpp -cppflags_force=-I ../../include +cppflags_force=-I../../include cppflags= cflags_force=`pkg-config --cflags libSystem` -fPIC -cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all +cflags=-W -Wall -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs libSystem` ldflags= dist=Makefile,common.h,parser.h +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I../../include -DNDEBUG +cflags=-W -Wall -O2 -D_FORTIFY_SOURCE=2 -fstack-protector + #targets [libcpp] type=library diff --git a/src/project.conf b/src/project.conf index 7cf5338..c8ab96f 100644 --- a/src/project.conf +++ b/src/project.conf @@ -3,11 +3,18 @@ targets=cpp cppflags_force=-I ../include cppflags= cflags_force=`pkg-config --cflags libSystem` -fPIE -cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector-all +cflags=-W -Wall -g -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector ldflags_force=`pkg-config --libs libSystem` ldflags=-pie -Wl,-z,relro -Wl,-z,now dist=Makefile +#modes +[mode::debug] + +[mode::release] +cppflags_force=-I ../include -DNDEBUG +cflags=-W -Wall -O2 -pedantic -D_FORTIFY_SOURCE=2 -fstack-protector + #targets [cpp] type=binary