forked from xamarin/urho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaketvOS
57 lines (43 loc) · 2.69 KB
/
MaketvOS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# arm64, x86_64
ARCH=x86_64
SDK_VER=9.0
OUTPUT_DIR=Bin/tvOS
URHO_DIR=Urho3D/Urho3D_iOS
URHO_SOURCE_DIR=Urho3D/Source
ifeq ($(ARCH), x86_64)
TARGET=AppleTVSimulator
else
TARGET=AppleTVOS
endif
URHO_FLAGS=-I$(URHO_DIR)/include -I$(URHO_DIR)/include/Urho3D/ThirdParty -I$(URHO_DIR)/include/Urho3D/ThirdParty/Bullet -DURHO3D_SSE -DURHO3D_FILEWATCHER -DURHO3D_PROFILING -DURHO3D_LOGGING -DKNET_UNIX -DURHO3D_OPENGL -DURHO3D_ANGELSCRIPT -DURHO3D_NAVIGATION -DURHO3D_NETWORK -DURHO3D_PHYSICS -DURHO3D_URHO2D -DURHO3D_STATIC_DEFINE -DIOS
URHO_LIBS=-framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -Wl,-search_paths_first -Wl,-headerpad_max_install_names $(URHO_DIR)/lib/libUrho3D.a -ldl -lpthread
CXXFLAGS=-g -Wno-address-of-temporary -Wno-return-type-c-linkage -Wno-c++11-extensions $(URHO_FLAGS)
TARGET_BASE=/Applications/Xcode.app/Contents/Developer/Platforms/$(TARGET).platform
XCODE_FRAMEWORKS=$(TARGET_BASE)/Developer/SDKs/$(TARGET)$(SDK_VER).sdk/System/Library/Frameworks/
XCODE_INCLUDES=$(TARGET_BASE)/Developer/SDKs/$(TARGET)$(SDK_VER).sdk/usr/include
XCODE_SDK=$(TARGET_BASE)/Developer/SDKs/$(TARGET)$(SDK_VER).sdk
CPP=clang++ -arch $(ARCH) -F$(XCODE_FRAMEWORKS) -I$(XCODE_INCLUDES) -isysroot $(XCODE_SDK) $(CXXFLAGS)
Urho3D_IOS:
rm -rf $(URHO_DIR) && mkdir -p $(URHO_DIR) && $(URHO_SOURCE_DIR)/./cmake_ios.sh $(URHO_DIR)
libUrho3D.a: Urho3D_IOS
ifeq ($(ARCH), x86_64)
cd $(URHO_DIR) && xcodebuild -arch "x86_64" ONLY_ACTIVE_ARCH=NO VALID_ARCHS="x86_64" -target Urho3D -sdk appletvsimulator
else
cd $(URHO_DIR) && xcodebuild ARCHS=$(ARCH) ONLY_ACTIVE_ARCH=NO -target Urho3D -configuration Release -sdk appletvos
endif
MakeBinDirectory:
mkdir -p $(OUTPUT_DIR)
libmono-urho.dylib: MakeBinDirectory libUrho3D.a vector.o binding.o glue.o events.o ApplicationProxy.o
mkdir -p $(OUTPUT_DIR) && $(CPP) -dynamiclib -g -o $(OUTPUT_DIR)/libmono-urho_$(ARCH).dylib -g $(URHO_LIBS) $(OUTPUT_DIR)/binding.o $(OUTPUT_DIR)/glue.o $(OUTPUT_DIR)/vector.o $(OUTPUT_DIR)/events.o $(OUTPUT_DIR)/ApplicationProxy.o
fat-libmono-urho.dylib:
make libmono-urho.dylib -f MaketvOS ARCH="x86_64" && make libmono-urho.dylib -f MaketvOS ARCH="arm64" && cd $(OUTPUT_DIR) && lipo -create libmono-urho_x86_64.dylib libmono-urho_arm64.dylib -output libmono-urho.dylib
binding.o:
$(CPP) -c -o $(OUTPUT_DIR)/binding.o Bindings/generated/binding.cpp
glue.o:
$(CPP) -c -o $(OUTPUT_DIR)/glue.o Bindings/src/glue.cpp
vector.o:
$(CPP) -c -o $(OUTPUT_DIR)/vector.o Bindings/src/vector.cpp
events.o:
$(CPP) -c -o $(OUTPUT_DIR)/events.o Bindings/generated/events.cpp
ApplicationProxy.o:
$(CPP) -c -o $(OUTPUT_DIR)/ApplicationProxy.o Bindings/src/ApplicationProxy.cpp