From 374c448b7d16b05185c06abc9c2e167230f1f09e Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Fri, 27 Sep 2024 15:13:57 +0200 Subject: [PATCH] build: added default linker flag in case pkg-config doesn't have z3 in its database, such as in NIX; fixes opp_env issue #24 (https://github.com/omnetpp/opp_env/issues/24) --- src/makefrag | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/makefrag b/src/makefrag index 1a6a24db8d9..e048aec1760 100644 --- a/src/makefrag +++ b/src/makefrag @@ -80,11 +80,15 @@ endif WITH_Z3 := $(shell (cd .. && $(FEATURETOOL) -q isenabled Z3GateSchedulingConfigurator && echo enabled) ) ifeq ($(WITH_Z3), enabled) ifeq ($(HAVE_PKGCFG), yes) - HAVE_Z3 := $(shell $(PKGCFG) --exists z3 && echo yes || echo no) + HAVE_Z3 := $(shell $(PKGCFG) --exists z3 && echo yes) ifeq ($(HAVE_Z3), yes) - LIBS += $(shell $(PKGCFG) --libs z3) - CFLAGS += $(shell $(PKGCFG) --cflags z3) -DHAVE_Z3 + Z3_LIBS := $(shell $(PKGCFG) --libs z3) + Z3_CFLAGS := $(shell $(PKGCFG) --clags z3) + else + Z3_LIBS := -lz3 # default in case pkg-config doesn't have z3 in its database (such as in NIX) endif + LIBS += $(Z3_LIBS) + CFLAGS += $(Z3_CFLAGS) -DHAVE_Z3 endif endif