From 73934ad2fd05831046e48163f8d30c21c475bb9e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 9 Jun 2017 15:49:03 +0200 Subject: [PATCH] add ld option `-pthread` when LTC_PTHREAD is enabled --- makefile_include.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index 0dd17da..68b9264 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -42,8 +42,9 @@ endif endif endif - +# # Compilation flags. Note the += does not write over the user's CFLAGS! +# CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE ifdef OLD_GCC @@ -99,6 +100,10 @@ CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" endif +ifneq ($(findstring -DLTC_PTHREAD,$(CFLAGS)),) +LDFLAGS += -pthread +endif + #List of demo objects DSOURCES = $(wildcard demos/*.c) DOBJECTS = $(DSOURCES:.c=.o)