First few changes to build a tvOS target
This commit is contained in:
@@ -138,7 +138,7 @@ class HXProject {
|
||||
defaultWindow.height = 0;
|
||||
defaultWindow.fps = 60;
|
||||
|
||||
case ANDROID, BLACKBERRY, IOS, TIZEN, WEBOS:
|
||||
case ANDROID, BLACKBERRY, IOS, TIZEN, WEBOS, TVOS:
|
||||
|
||||
platformType = PlatformType.MOBILE;
|
||||
|
||||
@@ -158,6 +158,8 @@ class HXProject {
|
||||
|
||||
}
|
||||
|
||||
} else if (target == Platform.TVOS) {
|
||||
architectures = [ Architecture.ARM64 ];
|
||||
} else {
|
||||
|
||||
architectures = [ Architecture.ARMV6 ];
|
||||
|
||||
@@ -21,6 +21,7 @@ package lime.project;
|
||||
var WIIU = "wiiu";
|
||||
var XBOX1 = "xbox1";
|
||||
var EMSCRIPTEN = "emscripten";
|
||||
var TVOS = "tvos";
|
||||
var CUSTOM = null;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import openfl.net.URLLoader;
|
||||
import sys.FileSystem;
|
||||
#end
|
||||
|
||||
#if ios
|
||||
#if (ios || tvos)
|
||||
import openfl.utils.SystemPath;
|
||||
#end
|
||||
|
||||
@@ -305,7 +305,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
|
||||
public override function getPath (id:String):String {
|
||||
|
||||
#if ios
|
||||
#if (ios || tvos)
|
||||
|
||||
return SystemPath.applicationDirectory + "/assets/" + path.get (id);
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
var bytes = ByteArray.readFile ("assets/manifest");
|
||||
#elseif (mac && java)
|
||||
var bytes = ByteArray.readFile ("../Resources/manifest");
|
||||
#elseif ios
|
||||
#elseif (ios || tvos)
|
||||
var bytes = ByteArray.readFile ("assets/manifest");
|
||||
#else
|
||||
var bytes = ByteArray.readFile ("manifest");
|
||||
@@ -821,7 +821,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
|
||||
#else
|
||||
|
||||
::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }}
|
||||
::if (assets != null)::::foreach assets::::if (!embed)::::if (type == "font")::@:keep #if display private #end class __ASSET__::flatName:: extends lime.text.Font { public function new () { __fontPath = #if (ios || tvos) "assets/" + #end "::targetPath::"; name = "::fontName::"; super (); }}
|
||||
::end::::end::::end::::end::
|
||||
|
||||
#if (windows || mac || linux || cpp)
|
||||
@@ -839,7 +839,7 @@ class DefaultAssetLibrary extends AssetLibrary {
|
||||
#end
|
||||
|
||||
#if (openfl && !flash)
|
||||
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = #if ios "assets/" + #end "::targetPath::"; name = "::fontName::";::end:: super (); }}
|
||||
::if (assets != null)::::foreach assets::::if (type == "font")::@:keep #if display private #end class __ASSET__OPENFL__::flatName:: extends openfl.text.Font { public function new () { ::if (embed)::var font = new __ASSET__::flatName:: (); src = font.src; name = font.name;::else::__fontPath = #if (ios || tvos) "assets/" + #end "::targetPath::"; name = "::fontName::";::end:: super (); }}
|
||||
::end::::end::::end::
|
||||
#end
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
-main ApplicationMain ::HAXE_FLAGS::
|
||||
-D iphone
|
||||
-D ios
|
||||
-D tvos
|
||||
--macro keep("::APP_MAIN::")
|
||||
-D no-compilation
|
||||
@@ -48,35 +48,35 @@ LIB_DEST := $(DEBUG)/libApplicationMain.a
|
||||
build-haxe-i386:
|
||||
@echo "Haxe simulator build: $(CONFIG)"
|
||||
haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim.a ../lib/i386$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-x86_64:
|
||||
@echo "Haxe simulator build: $(CONFIG)-64"
|
||||
haxe Build.hxml -D simulator -D HXCPP_M64 -cpp build/$(CONFIG)-64 $(DEBUG)
|
||||
cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_M64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -Dsimulator -DHXCPP_M64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphonesim-64.a ../lib/x86_64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv6:
|
||||
@echo "Haxe device build: $(CONFIG)"
|
||||
haxe Build.hxml -D HXCPP_ARMV6 -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cp build/$(CONFIG)/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos.a ../lib/armv6$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv7:
|
||||
@echo "Haxe device build: $(CONFIG)-v7"
|
||||
haxe Build.hxml -D HXCPP_ARMV7 -cpp build/$(CONFIG)-v7 $(DEBUG)
|
||||
cd build/$(CONFIG)-v7; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cd build/$(CONFIG)-v7; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cp build/$(CONFIG)-v7/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-v7.a ../lib/armv7$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-arm64:
|
||||
@echo "Haxe device build: $(CONFIG)-64"
|
||||
haxe Build.hxml -D HXCPP_ARM64 -cpp build/$(CONFIG)-64 $(DEBUG)
|
||||
cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARM64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cd build/$(CONFIG)-64; export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dtvos -DHXCPP_ARM64 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG) `cat Options.txt | while read LINE; do printf " -D$$LINE"; done`
|
||||
cp build/$(CONFIG)-64/::CPP_LIBPREFIX::ApplicationMain$(DEBUG).iphoneos-64.a ../lib/arm64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
|
||||
@@ -582,6 +582,10 @@ class CommandLineTools {
|
||||
|
||||
platform = new EmscriptenPlatform (command, project, targetFlags);
|
||||
|
||||
case TVOS:
|
||||
|
||||
platform = new IOSPlatform (command, project, targetFlags);
|
||||
|
||||
default:
|
||||
|
||||
}
|
||||
@@ -746,6 +750,7 @@ class CommandLineTools {
|
||||
LogHelper.println (" \x1b[1mlinux\x1b[0m -- Create a Linux application");
|
||||
LogHelper.println (" \x1b[1mmac\x1b[0m -- Create a Mac OS X application");
|
||||
LogHelper.println (" \x1b[1mtizen\x1b[0m -- Create a Tizen application");
|
||||
LogHelper.println (" \x1b[1mtvos\x1b[0m -- Create a tvOS application");
|
||||
LogHelper.println (" \x1b[1mwebos\x1b[0m -- Create a webOS application");
|
||||
LogHelper.println (" \x1b[1mwindows\x1b[0m -- Create a Windows application");
|
||||
LogHelper.println ("");
|
||||
|
||||
@@ -475,6 +475,14 @@ class PlatformSetup {
|
||||
|
||||
setupOpenFL ();
|
||||
|
||||
case "tvos":
|
||||
|
||||
if (PlatformHelper.hostPlatform == Platform.MAC) {
|
||||
|
||||
setupMac ();
|
||||
|
||||
}
|
||||
|
||||
case "":
|
||||
|
||||
switch (CommandLineTools.defaultLibrary) {
|
||||
|
||||
Reference in New Issue
Block a user