Skip to content

Commit 84a5a2e

Browse files
committed
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 (omnetpp/opp_env#24)
1 parent c1daa45 commit 84a5a2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/makefrag

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ endif
8080
WITH_Z3 := $(shell (cd .. && $(FEATURETOOL) -q isenabled Z3GateSchedulingConfigurator && echo enabled) )
8181
ifeq ($(WITH_Z3), enabled)
8282
ifeq ($(HAVE_PKGCFG), yes)
83-
HAVE_Z3 := $(shell $(PKGCFG) --exists z3 && echo yes || echo no)
83+
HAVE_Z3 := $(shell $(PKGCFG) --exists z3 && echo yes)
8484
ifeq ($(HAVE_Z3), yes)
85-
LIBS += $(shell $(PKGCFG) --libs z3)
86-
CFLAGS += $(shell $(PKGCFG) --cflags z3) -DHAVE_Z3
85+
Z3_LIBS := $(shell $(PKGCFG) --libs z3)
86+
Z3_CFLAGS := $(shell $(PKGCFG) --cflags z3)
87+
else
88+
Z3_LIBS := -lz3 # default in case pkg-config doesn't have z3 in its database (such as in NIX)
8789
endif
90+
LIBS += $(Z3_LIBS)
91+
CFLAGS += $(Z3_CFLAGS) -DHAVE_Z3
8892
endif
8993
endif
9094

0 commit comments

Comments
 (0)