From 0051b4e9e2fd91ecc6c1897936688cc184bd825c Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 15 Oct 2025 08:34:01 +0200 Subject: [PATCH] Try executable_path on macos --- Makefile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 82d9427..8db2874 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,14 @@ LIBS_DIR := $(abspath ./libs) UNAME_S := $(shell uname -s) -# Flags for CGO to find the headers and the shared library -# ifeq ($(UNAME_S),Darwin) -# CGO_CFLAGS := -I$(LIBS_DIR) -# CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/./libs -# else -# CGO_CFLAGS := -I$(LIBS_DIR) -# CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) -# endif -CGO_CFLAGS := -I$(LIBS_DIR) -CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) +Flags for CGO to find the headers and the shared library +ifeq ($(UNAME_S),Darwin) + CGO_CFLAGS := -I$(LIBS_DIR) + CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path/./libs +else + CGO_CFLAGS := -I$(LIBS_DIR) + CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) +endif ifeq ($(OS),Windows_NT) BIN_NAME := example.exe