Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ lib/googletest/
# Python compiled files
**/*.pyc

/python/*.so
/python/*.o
/python/*.cxx
/python/irhvac.py

# Unit Test builds
test/*.o
test/*.a
Expand Down
12 changes: 10 additions & 2 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ else
SWIGTYPE = global
endif

UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
# macOS: extensions are bundles with dynamic_lookup; don't link libpython
SHARED_FLAGS = -bundle -undefined dynamic_lookup
else
SHARED_FLAGS = -shared -Wl,-soname,lib_irhvac.so
endif

# Where to find user code.
SRC_DIR = ../src

Expand All @@ -40,7 +48,7 @@ objects = $(patsubst %.cpp,%,$(wildcard *.cpp))
all : _irhvac.so

library : $(objects)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,lib_irhvac.so -o _irhvac.so $(COMMON_OBJ)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(SHARED_FLAGS) -o _irhvac.so $(COMMON_OBJ)

swig : libirhvac_wrap.cxx
ifneq (,$(wildcard /.dockerenv))
Expand Down Expand Up @@ -101,7 +109,7 @@ libirhvac_wrap.cxx :
swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i

_irhvac.so : $(COMMON_OBJ)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,lib_irhvac.so -o _irhvac.so $(COMMON_OBJ)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(SHARED_FLAGS) -o _irhvac.so $(COMMON_OBJ)

swig-4.2.0/swig :
curl -s -L -o - http://downloads.sourceforge.net/project/swig/swig/swig-4.2.0/swig-4.2.0.tar.gz | tar xfz -
Expand Down
Loading