diff --git a/admin/osx/mac-crafter/Sources/Utils/Craft.swift b/admin/osx/mac-crafter/Sources/Utils/Craft.swift new file mode 100644 index 0000000000..738933f0e0 --- /dev/null +++ b/admin/osx/mac-crafter/Sources/Utils/Craft.swift @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2024 by Claudio Cambra + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +func archToCraftTarget(_ arch: String) -> String { + return arch == "arm64" ? "macos-clang-arm64" : "macos-64-clang" +} diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 87bb3e354f..fada690b45 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -128,7 +128,7 @@ struct Build: ParsableCommand { let craftMasterDir = "\(buildPath)/craftmaster" let craftMasterIni = "\(repoRootDir)/craftmaster.ini" let craftMasterPy = "\(craftMasterDir)/CraftMaster.py" - let craftTarget = arch == "arm64" ? "macos-clang-arm64" : "macos-64-clang" + let craftTarget = archToCraftTarget(arch) let craftCommand = "python3 \(craftMasterPy) --config \(craftMasterIni) --target \(craftTarget) -c"