Skip to content

Commit

Permalink
Statically linking luajit on OSX builds
Browse files Browse the repository at this point in the history
This will make the .so larger :(
  • Loading branch information
yancouto committed Mar 1, 2020
1 parent 7fa56f2 commit 896f77f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third-party"]
path = third-party
url = https://github.com/uspgamedev/luasteam-third-party
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ STDLIB_VER=-std=c++11
# -Wno-invalid-offsetof prevents STEAM_CALLBACK from giving out warnings
CPP_FLAGS=-Wno-invalid-offsetof -Wall

THIRD_PARTY=./third-party

OSX_OUT=luasteam.so
OSX_IPATHS=-I/usr/local/include/luajit-2.0
OSX_FLAGS=$(OSX_IPATHS) $(STDLIB_VER) -lluajit-5.1
OSX_IPATHS=-I$(THIRD_PARTY)/include/
OSX_FLAGS=$(OSX_IPATHS) $(STDLIB_VER)

GNU_OUT=luasteam.so
GNU_IPATHS=-I/usr/include/luajit-2.0
Expand All @@ -20,7 +22,7 @@ all:
STEAM_LIB=sdk/redistributable_bin

osx:
$(CXX) $(SRC) $(CPP_FLAGS) ${STEAM_LIB}/osx32/libsteam_api.dylib -o $(OSX_OUT) -shared -fPIC $(OSX_FLAGS)
$(CXX) $(SRC) $(CPP_FLAGS) ${STEAM_LIB}/osx32/libsteam_api.dylib ${THIRD_PARTY}/lib/libluajit-5.1.a -o $(OSX_OUT) -shared -fPIC $(OSX_FLAGS)

linux32:
$(CXX) $(SRC) $(CPP_FLAGS) ${STEAM_LIB}/linux32/libsteam_api.so -m32 -o $(GNU_OUT) -shared -fPIC $(GNU_FLAGS)
Expand Down
1 change: 1 addition & 0 deletions third-party
Submodule third-party added at ff02f2

0 comments on commit 896f77f

Please sign in to comment.