Skip to content

Commit

Permalink
Build for iOS simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
dapetcu21 committed May 2, 2019
1 parent 8390df9 commit b91d188
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
22 changes: 18 additions & 4 deletions bridge/Makefile.ios
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
LIBPATH := ../fmod/lib/ios/libfmodbridge.a
LIBPATH_SIM := ../fmod/lib/x86_64-ios/libfmodbridge_simulator.a

SOURCES = \
src/fmod_init.cpp \
Expand All @@ -13,24 +14,37 @@ HEADERS = \
src/fmod_helpers.hpp

CXX := xcrun --sdk iphoneos c++ -isysroot `xcrun --sdk iphoneos --show-sdk-path` -arch arm64 -arch armv7s -arch armv7
CXX_SIM := xcrun --sdk iphoneos c++ -isysroot `xcrun --sdk iphonesimulator --show-sdk-path` -arch x86_64

CXXFLAGS := -std=c++11 -O3 -fvisibility=hidden -I./include -miphoneos-version-min=8.0

all: $(LIBPATH)
all: $(LIBPATH) $(LIBPATH_SIM)

OBJECTS = $(patsubst src/%.cpp,build/ios-cpp-%.o,$(SOURCES))
OBJCPP_OBJECTS = $(patsubst src/%.mm,build/ios-mm-%.o,$(OBJCPP_SOURCES))
OBJECTS_OBJCPP = $(patsubst src/%.mm,build/ios-mm-%.o,$(OBJCPP_SOURCES))

OBJECTS_SIM = $(patsubst src/%.cpp,build/iossim-cpp-%.o,$(SOURCES))
OBJECTS_OBJCPP_SIM = $(patsubst src/%.mm,build/iossim-mm-%.o,$(OBJCPP_SOURCES))

build/ios-cpp-%.o: src/%.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) -c $< -o $@

build/iossim-cpp-%.o: src/%.cpp $(HEADERS)
$(CXX_SIM) $(CXXFLAGS) -c $< -o $@

build/ios-mm-%.o: src/%.mm $(HEADERS)
$(CXX) $(CXXFLAGS) -c $< -o $@

$(LIBPATH): $(OBJECTS) $(OBJCPP_OBJECTS)
build/iossim-mm-%.o: src/%.mm $(HEADERS)
$(CXX_SIM) $(CXXFLAGS) -c $< -o $@

$(LIBPATH): $(OBJECTS) $(OBJECTS_OBJCPP)
xcrun --sdk iphoneos libtool -static $^ -o $@

$(LIBPATH_SIM): $(OBJECTS_SIM) $(OBJECTS_OBJCPP_SIM)
xcrun --sdk iphonesimulator libtool -static $^ -o $@

clean:
rm -f $(LIBPATH) build/ios-*.o
rm -f $(LIBPATH) build/ios-*.o build/iossim-*.o

.PHONY: all clean
5 changes: 5 additions & 0 deletions fmod/ext.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ platforms:
frameworks: ["AVFoundation"]
libs: ["c++"]

x86_64-ios:
context:
frameworks: ["AVFoundation"]
libs: ["c++"]

x86_64-osx:
context:
libs: ["c++"]
Binary file modified fmod/lib/ios/libfmodbridge.a
Binary file not shown.
Binary file added fmod/lib/x86_64-ios/libfmod_iphonesimulator.a
Binary file not shown.
Binary file added fmod/lib/x86_64-ios/libfmodbridge_simulator.a
Binary file not shown.
Binary file not shown.

0 comments on commit b91d188

Please sign in to comment.