Try executable_path on macos

This commit is contained in:
Arnaud 2025-10-15 08:34:01 +02:00
parent 65d11e40f7
commit 0051b4e9e2
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -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