Fix builds for iOS x86_64, arm64, improve code caching, speed up build
This commit is contained in:
@@ -390,11 +390,21 @@
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = (
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=i386]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
::foreach frameworkSearchPaths:: "\"::__current__::\"",
|
||||
@@ -429,10 +439,18 @@
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = (
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=i386]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
::foreach frameworkSearchPaths:: "\"::__current__::\"",
|
||||
|
||||
@@ -48,24 +48,38 @@ LIB_DEST := $(DEBUG)/libApplicationMain.a
|
||||
export HXCPP_COMPILE_THREADS := 2
|
||||
|
||||
build-haxe-i386:
|
||||
@echo "Haxe simulator build CONFIG : $(CONFIG)"
|
||||
@echo "Haxe simulator build: $(CONFIG)"
|
||||
haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphonesim.a ../lib/i386$(LIB_DEST)
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp build/$(CONFIG)/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)
|
||||
cp build/$(CONFIG)-64/ApplicationMain$(DEBUG).iphonesim-64.a ../lib/x86_64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv6:
|
||||
@echo "Haxe armv6 build CONFIG : $(CONFIG)"
|
||||
@echo "Haxe device build: $(CONFIG)"
|
||||
haxe Build.hxml -D HXCPP_ARMV6 -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphoneos.a ../lib/armv6$(LIB_DEST)
|
||||
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)
|
||||
cp build/$(CONFIG)/ApplicationMain$(DEBUG).iphoneos.a ../lib/armv6$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv7:
|
||||
@echo "Haxe armv7 build CONFIG : $(CONFIG)"
|
||||
haxe Build.hxml -D HXCPP_ARMV7 -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphoneos-v7.a ../lib/armv7$(LIB_DEST)
|
||||
@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)
|
||||
cp build/$(CONFIG)-v7/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)
|
||||
cp build/$(CONFIG)-64/ApplicationMain$(DEBUG).iphoneos-64.a ../lib/arm64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
clean:
|
||||
|
||||
@@ -390,11 +390,21 @@
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = (
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=i386]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64-debug\"",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
::foreach frameworkSearchPaths:: "\"::__current__::\"",
|
||||
@@ -429,10 +439,18 @@
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/armv7\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = (
|
||||
"LIBRARY_SEARCH_PATHS[arch=arm64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/arm64\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=i386]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/i386\"",
|
||||
);
|
||||
"LIBRARY_SEARCH_PATHS[arch=x86_64]" = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/::APP_FILE::/lib/x86_64\"",
|
||||
);
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
::foreach frameworkSearchPaths:: "::__current__::",
|
||||
|
||||
@@ -48,24 +48,38 @@ LIB_DEST := $(DEBUG)/libApplicationMain.a
|
||||
export HXCPP_COMPILE_THREADS := 2
|
||||
|
||||
build-haxe-i386:
|
||||
@echo "Haxe simulator build CONFIG : $(CONFIG)"
|
||||
@echo "Haxe simulator build: $(CONFIG)"
|
||||
haxe Build.hxml -D simulator -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphonesim.a ../lib/i386$(LIB_DEST)
|
||||
cd build/$(CONFIG); export HXCPP_NO_COLOR=1; haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -Dsimulator -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp build/$(CONFIG)/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)
|
||||
cp build/$(CONFIG)-64/ApplicationMain$(DEBUG).iphonesim-64.a ../lib/x86_64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv6:
|
||||
@echo "Haxe armv6 build CONFIG : $(CONFIG)"
|
||||
@echo "Haxe device build: $(CONFIG)"
|
||||
haxe Build.hxml -D HXCPP_ARMV6 -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV6 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphoneos.a ../lib/armv6$(LIB_DEST)
|
||||
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)
|
||||
cp build/$(CONFIG)/ApplicationMain$(DEBUG).iphoneos.a ../lib/armv6$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
build-haxe-armv7:
|
||||
@echo "Haxe armv7 build CONFIG : $(CONFIG)"
|
||||
haxe Build.hxml -D HXCPP_ARMV7 -cpp build/$(CONFIG) $(DEBUG)
|
||||
cd build/$(CONFIG); haxelib run ::CPP_BUILD_LIBRARY:: Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11 $(DEF_DEBUG) $(HXCPP_CLANG)
|
||||
cp $(LIB_BASE).iphoneos-v7.a ../lib/armv7$(LIB_DEST)
|
||||
@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)
|
||||
cp build/$(CONFIG)-v7/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)
|
||||
cp build/$(CONFIG)-64/ApplicationMain$(DEBUG).iphoneos-64.a ../lib/arm64$(LIB_DEST)
|
||||
touch ../Classes/Main.mm
|
||||
|
||||
clean:
|
||||
|
||||
@@ -293,7 +293,8 @@ class IOSPlatform extends PlatformTarget {
|
||||
var armv7 = (command == "rebuild" || (project.architectures.indexOf (Architecture.ARMV7) > -1 && !project.targetFlags.exists ("simulator")));
|
||||
var armv7s = (project.architectures.indexOf (Architecture.ARMV7S) > -1 && !project.targetFlags.exists ("simulator"));
|
||||
var arm64 = (command == "rebuild" || (project.architectures.indexOf (Architecture.ARM64) > -1 && !project.targetFlags.exists ("simulator")));
|
||||
var simulator = (command == "rebuild" || project.targetFlags.exists ("simulator"));
|
||||
var i386 = (command == "rebuild" || project.targetFlags.exists ("simulator"));
|
||||
var x86_64 = (command == "rebuild" || project.targetFlags.exists ("simulator"));
|
||||
|
||||
var commands = [];
|
||||
|
||||
@@ -301,7 +302,8 @@ class IOSPlatform extends PlatformTarget {
|
||||
if (armv7) commands.push ([ "-Diphoneos", "-DHXCPP_CPP11", "-DHXCPP_ARMV7" ]);
|
||||
if (armv7s) commands.push ([ "-Diphoneos", "-DHXCPP_CPP11", "-DHXCPP_ARMV7S" ]);
|
||||
if (arm64) commands.push ([ "-Diphoneos", "-DHXCPP_CPP11", "-DHXCPP_ARM64" ]);
|
||||
if (simulator) commands.push ([ "-Diphonesim", "-DHXCPP_CPP11" ]);
|
||||
if (i386) commands.push ([ "-Diphonesim", "-DHXCPP_CPP11" ]);
|
||||
if (x86_64) commands.push ([ "-Diphonesim", "-DHXCPP_M64", "-DHXCPP_CPP11" ]);
|
||||
|
||||
CPPHelper.rebuild (project, commands);
|
||||
|
||||
@@ -374,12 +376,18 @@ class IOSPlatform extends PlatformTarget {
|
||||
|
||||
if (!match) {
|
||||
|
||||
LogHelper.info ("", " - \x1b[1mGenerating image:\x1b[0m " + PathHelper.combine (projectDirectory, splashScreenNames[i]));
|
||||
var splashScreenPath = PathHelper.combine (projectDirectory, splashScreenNames[i]);
|
||||
|
||||
var image = new Image (null, 0, 0, width, height, (0xFF << 24) | (project.window.background & 0xFFFFFF));
|
||||
var bytes = image.encode ("png");
|
||||
|
||||
File.saveBytes (PathHelper.combine (projectDirectory, splashScreenNames[i]), bytes);
|
||||
if (!FileSystem.exists (splashScreenPath)) {
|
||||
|
||||
LogHelper.info ("", " - \x1b[1mGenerating image:\x1b[0m " + PathHelper.combine (projectDirectory, splashScreenNames[i]));
|
||||
|
||||
var image = new Image (null, 0, 0, width, height, (0xFF << 24) | (project.window.background & 0xFFFFFF));
|
||||
var bytes = image.encode ("png");
|
||||
|
||||
File.saveBytes (splashScreenPath, bytes);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -399,9 +407,9 @@ class IOSPlatform extends PlatformTarget {
|
||||
|
||||
PathHelper.mkdir (projectDirectory + "/lib");
|
||||
|
||||
for (archID in 0...5) {
|
||||
for (archID in 0...6) {
|
||||
|
||||
var arch = [ "armv6", "armv7", "armv7s", "arm64", "i386" ][archID];
|
||||
var arch = [ "armv6", "armv7", "armv7s", "arm64", "i386", "x86_64" ][archID];
|
||||
|
||||
if (arch == "armv6" && !context.ARMV6)
|
||||
continue;
|
||||
@@ -415,7 +423,7 @@ class IOSPlatform extends PlatformTarget {
|
||||
if (arch == "arm64" && !context.ARM64)
|
||||
continue;
|
||||
|
||||
var libExt = [ ".iphoneos.a", ".iphoneos-v7.a", ".iphoneos-v7s.a", ".iphoneos-64.a", ".iphonesim.a" ][archID];
|
||||
var libExt = [ ".iphoneos.a", ".iphoneos-v7.a", ".iphoneos-v7s.a", ".iphoneos-64.a", ".iphonesim.a", ".iphonesim-64.a" ][archID];
|
||||
|
||||
PathHelper.mkdir (projectDirectory + "/lib/" + arch);
|
||||
PathHelper.mkdir (projectDirectory + "/lib/" + arch + "-debug");
|
||||
|
||||
Reference in New Issue
Block a user