Skip to content

Commit c1de77f

Browse files
committed
Try to fix macos
1 parent d2bf07d commit c1de77f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Destination folder for the downloaded libraries
22
LIBS_DIR := $(abspath ./libs)
33

4+
UNAME_S := $(shell uname -s)
5+
46
# Flags for CGO to find the headers and the shared library
5-
CGO_CFLAGS := -I$(LIBS_DIR)
6-
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
7+
ifeq ($(UNAME_S),Darwin)
8+
CGO_CFLAGS := -I$(LIBS_DIR)
9+
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/./libs
10+
else
11+
CGO_CFLAGS := -I$(LIBS_DIR)
12+
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
13+
endif
714

815
# Configuration for fetching the right binary
916
OS ?= "linux"

0 commit comments

Comments
 (0)