Merge branch 'develop' into 8.2.0-Dev
This commit is contained in:
@@ -145,11 +145,20 @@ class AndroidPlatform extends PlatformTarget
|
||||
var architectures = [];
|
||||
|
||||
if (hasARMV5) architectures.push(Architecture.ARMV5);
|
||||
if (hasARMV7 || (!hasARMV5 && !hasX86)) architectures.push(Architecture.ARMV7);
|
||||
if (hasARMV7) architectures.push(Architecture.ARMV7);
|
||||
if (hasARM64) architectures.push(Architecture.ARM64);
|
||||
if (hasX86) architectures.push(Architecture.X86);
|
||||
if (hasX64) architectures.push(Architecture.X64);
|
||||
|
||||
if (architectures.length == 0)
|
||||
{
|
||||
Log.warn("No architecture selected, defaulting to ARM64.");
|
||||
|
||||
hasARM64 = true;
|
||||
|
||||
architectures.push(Architecture.ARM64);
|
||||
}
|
||||
|
||||
for (architecture in architectures)
|
||||
{
|
||||
var haxeParams = [hxml, "-D", "android", "-D", "PLATFORM=android-21"];
|
||||
|
||||
@@ -480,8 +480,7 @@ class IOSPlatform extends PlatformTarget
|
||||
public override function rebuild():Void
|
||||
{
|
||||
var armv6 = (project.architectures.indexOf(Architecture.ARMV6) > -1 && !project.targetFlags.exists("simulator"));
|
||||
var armv7 = (command == "rebuild"
|
||||
|| (project.architectures.indexOf(Architecture.ARMV7) > -1 && !project.targetFlags.exists("simulator")));
|
||||
var armv7 = (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")));
|
||||
|
||||
@@ -33,9 +33,11 @@ class MacPlatform extends PlatformTarget
|
||||
private var contentDirectory:String;
|
||||
private var executableDirectory:String;
|
||||
private var executablePath:String;
|
||||
private var is64:Bool;
|
||||
private var targetArchitecture:Architecture;
|
||||
private var targetType:String;
|
||||
|
||||
private var dirSuffix(get, never):String;
|
||||
|
||||
public function new(command:String, _project:HXProject, targetFlags:Map<String, String>)
|
||||
{
|
||||
super(command, _project, targetFlags);
|
||||
@@ -93,20 +95,6 @@ class MacPlatform extends PlatformTarget
|
||||
title: ""
|
||||
};
|
||||
|
||||
switch (System.hostArchitecture)
|
||||
{
|
||||
case ARMV6:
|
||||
defaults.architectures = [ARMV6];
|
||||
case ARMV7:
|
||||
defaults.architectures = [ARMV7];
|
||||
case X86:
|
||||
defaults.architectures = [X86];
|
||||
case X64:
|
||||
defaults.architectures = [X64];
|
||||
default:
|
||||
defaults.architectures = [];
|
||||
}
|
||||
|
||||
defaults.window.allowHighDPI = false;
|
||||
|
||||
for (i in 1...project.windows.length)
|
||||
@@ -122,11 +110,13 @@ class MacPlatform extends PlatformTarget
|
||||
project.architectures.remove(excludeArchitecture);
|
||||
}
|
||||
|
||||
targetArchitecture = Type.createEnum(Architecture, Type.enumConstructor(System.hostArchitecture));
|
||||
for (architecture in project.architectures)
|
||||
{
|
||||
if (architecture == Architecture.X64)
|
||||
if (architecture.match(X86 | X64 | ARMV6 | ARMV7 | ARM64))
|
||||
{
|
||||
is64 = true;
|
||||
targetArchitecture = architecture;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +127,6 @@ class MacPlatform extends PlatformTarget
|
||||
else if (project.targetFlags.exists("hl") || project.targetFlags.exists("hlc"))
|
||||
{
|
||||
targetType = "hl";
|
||||
is64 = true;
|
||||
}
|
||||
else if (project.targetFlags.exists("java"))
|
||||
{
|
||||
@@ -157,7 +146,7 @@ class MacPlatform extends PlatformTarget
|
||||
}
|
||||
|
||||
targetDirectory = Path.combine(project.app.path, project.config.getString("mac.output-directory", targetType == "cpp" ? "macos" : targetType));
|
||||
targetDirectory = StringTools.replace(targetDirectory, "arch64", is64 ? "64" : "");
|
||||
targetDirectory = StringTools.replace(targetDirectory, "arch64", dirSuffix);
|
||||
applicationDirectory = targetDirectory + "/bin/" + project.app.file + ".app";
|
||||
contentDirectory = applicationDirectory + "/Contents/Resources";
|
||||
executableDirectory = applicationDirectory + "/Contents/MacOS";
|
||||
@@ -179,11 +168,11 @@ class MacPlatform extends PlatformTarget
|
||||
// TODO: Support single binary for HashLink
|
||||
if (targetType == "hl")
|
||||
{
|
||||
ProjectHelper.copyLibrary(project, ndll, "Mac" + (is64 ? "64" : ""), "", ".hdll", executableDirectory, project.debug, targetSuffix);
|
||||
ProjectHelper.copyLibrary(project, ndll, "Mac" + dirSuffix, "", ".hdll", executableDirectory, project.debug, targetSuffix);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProjectHelper.copyLibrary(project, ndll, "Mac" + (is64 ? "64" : ""), "",
|
||||
ProjectHelper.copyLibrary(project, ndll, "Mac" + dirSuffix, "",
|
||||
(ndll.haxelib != null
|
||||
&& (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll", executableDirectory,
|
||||
project.debug, targetSuffix);
|
||||
@@ -197,8 +186,8 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
if (noOutput) return;
|
||||
|
||||
NekoHelper.createExecutable(project.templatePaths, "mac" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath);
|
||||
NekoHelper.copyLibraries(project.templatePaths, "mac" + (is64 ? "64" : ""), executableDirectory);
|
||||
NekoHelper.createExecutable(project.templatePaths, "mac" + dirSuffix.toLowerCase(), targetDirectory + "/obj/ApplicationMain.n", executablePath);
|
||||
NekoHelper.copyLibraries(project.templatePaths, "mac" + dirSuffix.toLowerCase(), executableDirectory);
|
||||
}
|
||||
else if (targetType == "hl")
|
||||
{
|
||||
@@ -206,7 +195,7 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
if (noOutput) return;
|
||||
|
||||
HashlinkHelper.copyHashlink(project, targetDirectory, executableDirectory, executablePath, is64);
|
||||
HashlinkHelper.copyHashlink(project, targetDirectory, executableDirectory, executablePath, true);
|
||||
|
||||
if (project.targetFlags.exists("hlc"))
|
||||
{
|
||||
@@ -275,7 +264,7 @@ class MacPlatform extends PlatformTarget
|
||||
System.recursiveCopy(targetDirectory + "/obj/lib", Path.combine(executableDirectory, "lib"));
|
||||
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".jar",
|
||||
Path.combine(executableDirectory, project.app.file + ".jar"));
|
||||
JavaHelper.copyLibraries(project.templatePaths, "Mac" + (is64 ? "64" : ""), executableDirectory);
|
||||
JavaHelper.copyLibraries(project.templatePaths, "Mac" + dirSuffix, executableDirectory);
|
||||
}
|
||||
else if (targetType == "nodejs")
|
||||
{
|
||||
@@ -283,8 +272,8 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
if (noOutput) return;
|
||||
|
||||
// NekoHelper.createExecutable (project.templatePaths, "Mac" + (is64 ? "64" : ""), targetDirectory + "/obj/ApplicationMain.n", executablePath);
|
||||
// NekoHelper.copyLibraries (project.templatePaths, "Mac" + (is64 ? "64" : ""), executableDirectory);
|
||||
// NekoHelper.createExecutable (project.templatePaths, "Mac" + dirSuffix, targetDirectory + "/obj/ApplicationMain.n", executablePath);
|
||||
// NekoHelper.copyLibraries (project.templatePaths, "Mac" + dirSuffix, executableDirectory);
|
||||
}
|
||||
else if (targetType == "cs")
|
||||
{
|
||||
@@ -305,12 +294,18 @@ class MacPlatform extends PlatformTarget
|
||||
var haxeArgs = [hxml, "-D", "HXCPP_CLANG"];
|
||||
var flags = ["-DHXCPP_CLANG"];
|
||||
|
||||
if (is64)
|
||||
if (targetArchitecture == X64)
|
||||
{
|
||||
haxeArgs.push("-D");
|
||||
haxeArgs.push("HXCPP_M64");
|
||||
flags.push("-DHXCPP_M64");
|
||||
}
|
||||
else if (targetArchitecture == ARM64)
|
||||
{
|
||||
haxeArgs.push("-D");
|
||||
haxeArgs.push("HXCPP_ARM64");
|
||||
flags.push("-DHXCPP_ARM64");
|
||||
}
|
||||
|
||||
if (!project.targetFlags.exists("static"))
|
||||
{
|
||||
@@ -373,7 +368,7 @@ class MacPlatform extends PlatformTarget
|
||||
context.NODE_FILE = executableDirectory + "/ApplicationMain.js";
|
||||
context.HL_FILE = targetDirectory + "/obj/ApplicationMain" + (project.defines.exists("hlc") ? ".c" : ".hl");
|
||||
context.CPP_DIR = targetDirectory + "/obj/";
|
||||
context.BUILD_DIR = project.app.path + "/mac" + (is64 ? "64" : "");
|
||||
context.BUILD_DIR = project.app.path + "/mac" + dirSuffix.toLowerCase();
|
||||
|
||||
return context;
|
||||
}
|
||||
@@ -418,22 +413,27 @@ class MacPlatform extends PlatformTarget
|
||||
{
|
||||
var commands = [];
|
||||
|
||||
if (targetFlags.exists("hl") && System.hostArchitecture == X64)
|
||||
switch (System.hostArchitecture)
|
||||
{
|
||||
// TODO: Support single binary
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64", "-Dhashlink"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!targetFlags.exists("32") && (command == "rebuild" || System.hostArchitecture == X64))
|
||||
{
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64"]);
|
||||
}
|
||||
|
||||
if (!targetFlags.exists("64") && (targetFlags.exists("32") || System.hostArchitecture == X86))
|
||||
{
|
||||
case X64:
|
||||
if (targetFlags.exists("hl"))
|
||||
{
|
||||
// TODO: Support single binary
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64", "-Dhashlink"]);
|
||||
}
|
||||
else if (!targetFlags.exists("32"))
|
||||
{
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32"]);
|
||||
}
|
||||
case X86:
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32"]);
|
||||
}
|
||||
case ARM64:
|
||||
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_ARM64"]);
|
||||
default:
|
||||
}
|
||||
|
||||
if (targetFlags.exists("hl"))
|
||||
@@ -501,7 +501,7 @@ class MacPlatform extends PlatformTarget
|
||||
|
||||
if (ndll.path == null || ndll.path == "")
|
||||
{
|
||||
context.ndlls[i].path = NDLL.getLibraryPath(ndll, "Mac" + (is64 ? "64" : ""), "lib", ".a", project.debug);
|
||||
context.ndlls[i].path = NDLL.getLibraryPath(ndll, "Mac" + dirSuffix, "lib", ".a", project.debug);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,4 +576,11 @@ class MacPlatform extends PlatformTarget
|
||||
@ignore public override function trace():Void {}
|
||||
|
||||
@ignore public override function uninstall():Void {}
|
||||
|
||||
// Getters & Setters
|
||||
|
||||
private inline function get_dirSuffix():String
|
||||
{
|
||||
return targetArchitecture == X64 ? "64" : "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user