mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-21 16:49:19 +01:00
CI+build: Improve macOS builds (#1310)
This commit is contained in:
parent
03484d2146
commit
9a53b19403
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@ -176,7 +176,7 @@ jobs:
|
|||||||
path: ./bin/Cemu.exe
|
path: ./bin/Cemu.exe
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-12
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repo"
|
- name: "Checkout repo"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -198,17 +198,14 @@ jobs:
|
|||||||
- name: "Install system dependencies"
|
- name: "Install system dependencies"
|
||||||
run: |
|
run: |
|
||||||
brew update
|
brew update
|
||||||
brew install llvm@15 ninja nasm automake libtool
|
brew install ninja nasm automake libtool
|
||||||
brew install cmake ninja
|
|
||||||
|
|
||||||
- name: "Build and install molten-vk"
|
- name: "Install molten-vk"
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/KhronosGroup/MoltenVK.git
|
curl -L -O https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.9/MoltenVK-macos.tar
|
||||||
cd MoltenVK
|
tar xf MoltenVK-macos.tar
|
||||||
git checkout bf097edc74ec3b6dfafdcd5a38d3ce14b11952d6
|
sudo mkdir -p /usr/local/lib
|
||||||
./fetchDependencies --macos
|
sudo cp MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib /usr/local/lib
|
||||||
make macos
|
|
||||||
make install
|
|
||||||
|
|
||||||
- name: "Setup cmake"
|
- name: "Setup cmake"
|
||||||
uses: jwlawson/actions-setup-cmake@v2
|
uses: jwlawson/actions-setup-cmake@v2
|
||||||
@ -239,9 +236,8 @@ jobs:
|
|||||||
cd build
|
cd build
|
||||||
cmake .. ${{ env.BUILD_FLAGS }} \
|
cmake .. ${{ env.BUILD_FLAGS }} \
|
||||||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} \
|
-DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||||
-DMACOS_BUNDLE=ON \
|
-DMACOS_BUNDLE=ON \
|
||||||
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@15/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@15/bin/clang++ \
|
|
||||||
-G Ninja
|
-G Ninja
|
||||||
|
|
||||||
- name: "Build Cemu"
|
- name: "Build Cemu"
|
||||||
|
50
BUILD.md
50
BUILD.md
@ -16,11 +16,11 @@
|
|||||||
- [Compiling Errors](#compiling-errors)
|
- [Compiling Errors](#compiling-errors)
|
||||||
- [Building Errors](#building-errors)
|
- [Building Errors](#building-errors)
|
||||||
- [macOS](#macos)
|
- [macOS](#macos)
|
||||||
- [On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used](#on-apple-silicon-macs-rosetta-2-and-the-x86_64-version-of-homebrew-must-be-used)
|
|
||||||
- [Installing brew](#installing-brew)
|
- [Installing brew](#installing-brew)
|
||||||
- [Installing Dependencies](#installing-dependencies)
|
- [Installing Tool Dependencies](#installing-tool-dependencies)
|
||||||
- [Build Cemu using CMake and Clang](#build-cemu-using-cmake-and-clang)
|
- [Installing Library Dependencies](#installing-library-dependencies)
|
||||||
- [Updating Cemu and source code](#updating-cemu-and-source-code)
|
- [Build Cemu using CMake](#build-cemu-using-cmake)
|
||||||
|
- [Updating Cemu and source code](#updating-cemu-and-source-code)
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
@ -141,31 +141,41 @@ If you are getting a different error than any of the errors listed above, you ma
|
|||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
To compile Cemu, a recent enough compiler and STL with C++20 support is required! LLVM 13 and
|
To compile Cemu, a recent enough compiler and STL with C++20 support is required! LLVM 13 and below
|
||||||
below, built in LLVM, and Xcode LLVM don't support the C++20 feature set required. The OpenGL graphics
|
don't support the C++20 feature set required, so either install LLVM from Homebrew or make sure that
|
||||||
API isn't support on macOS, Vulkan must be used. Additionally Vulkan must be used through the
|
you have a recent enough version of Xcode. Xcode 15 is known to work. The OpenGL graphics API isn't
|
||||||
Molten-VK compatibility layer
|
supported on macOS, so Vulkan must be used through the Molten-VK compatibility layer.
|
||||||
|
|
||||||
### On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used
|
|
||||||
|
|
||||||
You can skip this section if you have an Intel Mac. Every time you compile, you need to perform steps 2.
|
|
||||||
|
|
||||||
1. `softwareupdate --install-rosetta` # Install Rosetta 2 if you don't have it. This only has to be done once
|
|
||||||
2. `arch -x86_64 zsh` # run an x64 shell
|
|
||||||
|
|
||||||
### Installing brew
|
### Installing brew
|
||||||
|
|
||||||
1. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
1. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||||
2. `eval "$(/usr/local/Homebrew/bin/brew shellenv)"` # set x86_64 brew env
|
2. Set up the Homebrew shell environment:
|
||||||
|
1. **On an Intel Mac:** `eval "$(/usr/local/Homebrew/bin/brew shellenv)"`
|
||||||
|
2. **On an Apple Silicon Mac:** eval `"$(/opt/homebrew/bin/brew shellenv)"`
|
||||||
|
|
||||||
### Installing Dependencies
|
### Installing Tool Dependencies
|
||||||
|
|
||||||
`brew install boost git cmake llvm ninja nasm molten-vk automake libtool`
|
The native versions of these can be used regardless of what type of Mac you have.
|
||||||
|
|
||||||
|
`brew install git cmake ninja nasm automake libtool`
|
||||||
|
|
||||||
|
### Installing Library Dependencies
|
||||||
|
|
||||||
|
**On Apple Silicon Macs, Rosetta 2 and the x86_64 version of Homebrew must be used to install these dependencies:**
|
||||||
|
1. `softwareupdate --install-rosetta` # Install Rosetta 2 if you don't have it. This only has to be done once
|
||||||
|
2. `arch -x86_64 zsh` # run an x64 shell
|
||||||
|
3. `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||||
|
4. `eval "$(/usr/local/Homebrew/bin/brew shellenv)"`
|
||||||
|
|
||||||
|
Then install the dependencies:
|
||||||
|
|
||||||
|
`brew install boost molten-vk`
|
||||||
|
|
||||||
|
### Build Cemu using CMake
|
||||||
|
|
||||||
### Build Cemu using CMake and Clang
|
|
||||||
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
1. `git clone --recursive https://github.com/cemu-project/Cemu`
|
||||||
2. `cd Cemu`
|
2. `cd Cemu`
|
||||||
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ -G Ninja`
|
3. `cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DCMAKE_OSX_ARCHITECTURES=x86_64 -G Ninja`
|
||||||
4. `cmake --build build`
|
4. `cmake --build build`
|
||||||
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
5. You should now have a Cemu executable file in the /bin folder, which you can run using `./bin/Cemu_release`.
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ endif()
|
|||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
enable_language(OBJC OBJCXX)
|
enable_language(OBJC OBJCXX)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
|
12
dependencies/ih264d/CMakeLists.txt
vendored
12
dependencies/ih264d/CMakeLists.txt
vendored
@ -117,7 +117,13 @@ add_library (ih264d
|
|||||||
"decoder/ivd.h"
|
"decoder/ivd.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
|
if (CMAKE_OSX_ARCHITECTURES)
|
||||||
|
set(IH264D_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES})
|
||||||
|
else()
|
||||||
|
set(IH264D_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (IH264D_ARCHITECTURE STREQUAL "x86_64" OR IH264D_ARCHITECTURE STREQUAL "amd64" OR IH264D_ARCHITECTURE STREQUAL "AMD64")
|
||||||
set(LIBAVCDEC_X86_INCLUDES "common/x86" "decoder/x86")
|
set(LIBAVCDEC_X86_INCLUDES "common/x86" "decoder/x86")
|
||||||
include_directories("common/" "decoder/" ${LIBAVCDEC_X86_INCLUDES})
|
include_directories("common/" "decoder/" ${LIBAVCDEC_X86_INCLUDES})
|
||||||
target_sources(ih264d PRIVATE
|
target_sources(ih264d PRIVATE
|
||||||
@ -140,7 +146,7 @@ target_sources(ih264d PRIVATE
|
|||||||
"decoder/x86/ih264d_function_selector_sse42.c"
|
"decoder/x86/ih264d_function_selector_sse42.c"
|
||||||
"decoder/x86/ih264d_function_selector_ssse3.c"
|
"decoder/x86/ih264d_function_selector_ssse3.c"
|
||||||
)
|
)
|
||||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
elseif(IH264D_ARCHITECTURE STREQUAL "aarch64" OR IH264D_ARCHITECTURE STREQUAL "arm64")
|
||||||
enable_language( C CXX ASM )
|
enable_language( C CXX ASM )
|
||||||
set(LIBAVCDEC_ARM_INCLUDES "common/armv8" "decoder/arm")
|
set(LIBAVCDEC_ARM_INCLUDES "common/armv8" "decoder/arm")
|
||||||
include_directories("common/" "decoder/" ${LIBAVCDEC_ARM_INCLUDES})
|
include_directories("common/" "decoder/" ${LIBAVCDEC_ARM_INCLUDES})
|
||||||
@ -178,7 +184,7 @@ target_sources(ih264d PRIVATE
|
|||||||
)
|
)
|
||||||
target_compile_options(ih264d PRIVATE -DARMV8)
|
target_compile_options(ih264d PRIVATE -DARMV8)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "ih264d unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
message(FATAL_ERROR "ih264d unknown architecture: ${IH264D_ARCHITECTURE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
project(CemuAsm C)
|
project(CemuAsm C)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
if (CMAKE_OSX_ARCHITECTURES)
|
||||||
|
set(CEMU_ASM_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES})
|
||||||
|
else()
|
||||||
|
set(CEMU_ASM_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CEMU_ASM_ARCHITECTURE MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
||||||
@ -40,8 +46,8 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64)|(AARCH64)")
|
elseif(CEMU_ASM_ARCHITECTURE MATCHES "(aarch64)|(AARCH64)|(arm64)|(ARM64)")
|
||||||
add_library(CemuAsm stub.cpp)
|
add_library(CemuAsm stub.cpp)
|
||||||
else()
|
else()
|
||||||
message(STATUS "CemuAsm - Unsupported arch: ${CMAKE_SYSTEM_PROCESSOR}")
|
message(STATUS "CemuAsm - Unsupported arch: ${CEMU_ASM_ARCHITECTURE}")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user