Skip to content

Commit

Permalink
Makefile: finalize OSX fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
  • Loading branch information
noxdafox committed Sep 5, 2023
1 parent c17aeb2 commit 6bff8be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
- name: Repair wheels
run: |
for whl in dist/*.whl; do
echo $whl
delocate-wheel -v "$whl"
done
- name: Store build artifacts
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ MAKEFILE_NAME ?= makefile
SHARED_INCLUDE_DIR ?= /usr/local/include
SHARED_LIBRARY_DIR ?= /usr/local/lib
TARGET_ARCH ?= $(shell uname -m)
OS_LDLIBS_PATH ?= /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
LINUX_LDLIBS ?= "-lm -lrt"
OSX_LDLIBS ?= "-lm -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"

# platform detection
PLATFORM = $(shell uname -s)
Expand All @@ -23,14 +24,14 @@ ifeq ($(PLATFORM),Darwin) # macOS
clips: clips_source
$(MAKE) -f $(MAKEFILE_NAME) -C clips_source \
CFLAGS="-std=c99 -O3 -fno-strict-aliasing -fPIC" \
LDLIBS="-lm -L$(OS_LDLIBS_PATH)"
ld clips_source/*.o -dylib -lm -L$(OS_LDLIBS_PATH) -arch $(TARGET_ARCH) \
LDLIBS=$(OSX_LDLIBS)
ld clips_source/*.o -dylib $(OSX_LDLIBS) -arch $(TARGET_ARCH) \
-o clips_source/libclips.so
else
clips: clips_source
$(MAKE) -f $(MAKEFILE_NAME) -C clips_source \
CFLAGS="-std=c99 -O3 -fno-strict-aliasing -fPIC" \
LDLIBS="-lm -lrt"
LDLIBS=$(LINUX_LDLIBS)
ld -G clips_source/*.o -o clips_source/libclips.so
endif

Expand Down

0 comments on commit 6bff8be

Please sign in to comment.