Convert lime.tools.Architecture to enum abstract. (#1754)
* Convert `lime.tools.Architecture` to `enum abstract`.
This improves compatibility with `hxp.HostArchitecture` and provides a more user-friendly API than `try { Type.createEnum() }`.
* Add category functions to `Architecture`.
* Fix errors related to `Architecture`'s new type.
* Standardize formatting.
* Re-implement `Architecture.match()` for backwards compatibility.
* Add `Architecture` constructor for clarity.
This commit is contained in:
@@ -2234,17 +2234,12 @@ class CommandLineTools
|
||||
{
|
||||
if (argument.substr(0, 4) == "-arm")
|
||||
{
|
||||
try
|
||||
{
|
||||
var name = argument.substr(1).toUpperCase();
|
||||
var value = Type.createEnum(Architecture, name);
|
||||
var value = new Architecture(argument.substr(1));
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
overrides.architectures.push(value);
|
||||
}
|
||||
if (value != null)
|
||||
{
|
||||
overrides.architectures.push(value);
|
||||
}
|
||||
catch (e:Dynamic) {}
|
||||
}
|
||||
else if (argument == "-64")
|
||||
{
|
||||
|
||||
@@ -112,10 +112,10 @@ class MacPlatform extends PlatformTarget
|
||||
project.architectures.remove(excludeArchitecture);
|
||||
}
|
||||
|
||||
targetArchitecture = Type.createEnum(Architecture, Type.enumConstructor(System.hostArchitecture));
|
||||
targetArchitecture = System.hostArchitecture;
|
||||
for (architecture in project.architectures)
|
||||
{
|
||||
if (architecture.match(X86 | X64 | ARMV6 | ARMV7 | ARM64))
|
||||
if (architecture.isARM() || architecture.isX())
|
||||
{
|
||||
targetArchitecture = architecture;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user