diff --git a/App/Build-App.lua b/App/Build-App.lua index 4dc8d51..1e206b9 100644 --- a/App/Build-App.lua +++ b/App/Build-App.lua @@ -42,4 +42,4 @@ project "App" defines { "DIST" } runtime "Release" optimize "On" - symbols "Off" \ No newline at end of file + symbols "Off" diff --git a/Build.lua b/Build.lua index 059b37b..1c62b50 100644 --- a/Build.lua +++ b/Build.lua @@ -1,6 +1,10 @@ -- premake5.lua workspace "New Project" - architecture "x64" + if os.host() == "macosx" then + architecture "ARM64" + else + architecture "x64" + end configurations { "Debug", "Release", "Dist" } startproject "App" @@ -14,4 +18,4 @@ group "Core" include "Core/Build-Core.lua" group "" -include "App/Build-App.lua" \ No newline at end of file +include "App/Build-App.lua" diff --git a/Core/Build-Core.lua b/Core/Build-Core.lua index 03a4b94..7ce37b9 100644 --- a/Core/Build-Core.lua +++ b/Core/Build-Core.lua @@ -34,4 +34,4 @@ project "Core" defines { "DIST" } runtime "Release" optimize "On" - symbols "Off" \ No newline at end of file + symbols "Off" diff --git a/README.md b/README.md index b9f4968..131835e 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ The `Scripts/` directory contains build scripts for Windows and Linux, and the ` 1. Clone this repository or use the "Use this template" button on GitHub to quickly set up your own repository based on this template 2. `App/` and `Core/` are the two projects - you can edit the names of these folders and their contents to suit 3. The three included Premake build files are `Build.lua`, `Core/Build-Core.lua` and `App/Build-App.lua` - you can edit these to customise your build configurations, edit the names of your projects and workspace/solution, etc. -4. Open the `Scripts/` directory and run the appropriate `Setup` script to generate projects files. You can edit the setup scripts to change the type of project that is generated - out of the box they are set to Visual Studio 2022 for Windows and gmake2 for Linux. +4. Open the `Scripts/` directory and run the appropriate `Setup` script to generate projects files. You can edit the setup scripts to change the type of project that is generated - out of the box they are set to Visual Studio 2022 for Windows, gmake2 for Linux, and Xcode for macOS. -Note that no macOS setup script is currently provided; you can duplicate the Linux script and adjust accordingly. +`Setup-macOS.sh` will generate an Xcode project targeting Apple silicon. ## Included - Some example code (in `App/Source` and `Core/Source`) to provide a starting point and test diff --git a/Scripts/Setup-macOS.sh b/Scripts/Setup-macOS.sh new file mode 100755 index 0000000..863b6a9 --- /dev/null +++ b/Scripts/Setup-macOS.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/.." + +pushd "$ROOT_DIR" +"$ROOT_DIR/Vendor/Binaries/Premake/macOS/premake5" --cc=clang --file=Build.lua xcode4 +popd