From 0f60cf2c019fcc87eb3e09f5f9f13ae60640055d Mon Sep 17 00:00:00 2001 From: Sheepit Renderfarm Date: Fri, 31 Dec 2021 15:22:37 +0000 Subject: [PATCH] Feat: add apple M1 cpu support --- src/com/sheepit/client/os/MacM1.java | 25 +++++++++++++++++++++++++ src/com/sheepit/client/os/OS.java | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/com/sheepit/client/os/MacM1.java diff --git a/src/com/sheepit/client/os/MacM1.java b/src/com/sheepit/client/os/MacM1.java new file mode 100644 index 0000000..0713c2d --- /dev/null +++ b/src/com/sheepit/client/os/MacM1.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Laurent CLOUET + * Author Laurent CLOUET + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package com.sheepit.client.os; + +public class MacM1 extends Mac { + @Override public String name() { + return "macm1"; + } +} diff --git a/src/com/sheepit/client/os/OS.java b/src/com/sheepit/client/os/OS.java index e7ebe24..d0eed93 100644 --- a/src/com/sheepit/client/os/OS.java +++ b/src/com/sheepit/client/os/OS.java @@ -105,7 +105,12 @@ public abstract class OS { instance = new Windows(); break; case "Apple": - instance = new Mac(); + if ("aarch64".equalsIgnoreCase(System.getProperty("os.arch"))) { // ARM arch ? + instance = new MacM1(); + } + else { + instance = new Mac(); + } break; case "GNU/Linux": instance = new Linux();