properly handle ARM for Export to Application on macOS

This commit is contained in:
Ben Fry
2022-06-19 10:11:07 -04:00
parent 80afb8a029
commit 4b6e675f40
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
<string>@@lsarchitecturepriority@@</string>
</array>
<key>LSEnvironment</key>
+7 -2
View File
@@ -849,7 +849,7 @@ public class JavaBuild {
// compared to the machine being used to build/export the sketch
// https://github.com/processing/processing/pull/4406
if (Preferences.getBoolean("run.options.memory") &&
!exportVariant.equals("arm")) {
!exportVariant.contains("arm")) {
runOptions.append("-Xms" + Preferences.get("run.options.memory.initial") + "m");
runOptions.append("-Xmx" + Preferences.get("run.options.memory.maximum") + "m");
}
@@ -870,7 +870,8 @@ public class JavaBuild {
}
}
/// macosx: write out Info.plist (template for classpath, etc)
/// macOS: write out Info.plist (template for classpath, etc)
if (exportPlatform == PConstants.MACOS) {
StringBuilder runOptionsXML = new StringBuilder();
@@ -911,6 +912,10 @@ public class JavaBuild {
sb.replace(index, index + "@@lsuipresentationmode@@".length(),
Preferences.getBoolean("export.application.present") ? "4" : "0");
}
while ((index = sb.indexOf("@@lsarchitecturepriority@@")) != -1) {
sb.replace(index, index + "@@lsarchitecturepriority@@".length(),
exportVariant.substring("macos-".length()));
}
lines[i] = sb.toString();
}