Skip to content

Commit

Permalink
Try to use swig without installing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
frawau committed Feb 20, 2024
1 parent 8eb036b commit 7ef4537
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Run tools unit tests
run: (cd tools; make run_tests)
- name: Build swig extension and run simple test
run: (apt-get -y install libpcre2-dev python3-dev; cd python; make testdocker)
run: (cd python; make testdocker)

Unit_Tests:
runs-on: ubuntu-latest
Expand Down
12 changes: 11 additions & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
# project, except GTEST_HEADERS, which you can use in your own targets
# but shouldn't modify.

ifeq (,$(wildcard ./.dockerenv))
SWIGTYPE = local
else
SWIGTYPE = global
endif

# Where to find user code.
SRC_DIR = ../src
Expand Down Expand Up @@ -38,7 +43,12 @@ library : $(objects)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,lib_irhvac.so -o _irhvac.so $(COMMON_OBJ)

swig : libirhvac_wrap.cxx
ifneq (,$(wildcard /.dockerenv))
SWIG_LIB=$(shell realpath -qe swig-4.2.0/Lib) ./swig-4.2.0/swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i
else
swig $(INCLUDES) $(DEFFLAGS) -c++ -python libirhvac.i
endif

clean :
rm -f *.o *.pyc *.cxx *.cpp
rm -rf swig-4.2.0
Expand Down Expand Up @@ -96,7 +106,7 @@ _irhvac.so : $(COMMON_OBJ)
swig-4.2.0/swig :
rm -rf swig-4.2.0
curl -s -L -o - http://downloads.sourceforge.net/project/swig/swig/swig-4.2.0/swig-4.2.0.tar.gz | tar xfz -
( cd swig-4.2.0; ./configure ; make; make install )
( cd swig-4.2.0; ./configure ; make )
# new specific targets goes above this line

$(objects) : %: $(COMMON_OBJ)
Expand Down

0 comments on commit 7ef4537

Please sign in to comment.