Skip to content

Commit

Permalink
build: added default linker flag in case pkg-config doesn't have z3 i…
Browse files Browse the repository at this point in the history
…n its database, such as in NIX; fixes opp_env issue #24 (omnetpp/opp_env#24)
  • Loading branch information
adamgeorge309 committed Sep 30, 2024
1 parent c1daa45 commit 6723bbf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -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) --cflags 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

Expand Down

0 comments on commit 6723bbf

Please sign in to comment.