From 02298983ecfd42cc2f67cd8584b6be56324f12de Mon Sep 17 00:00:00 2001 From: Gloria Goertz Date: Tue, 6 Oct 2026 00:27:17 +0200 Subject: [PATCH 1/3] Set CMAKE_OSX_DEPLOYMENT_TARGET to 12 Remove CMAKE_OSX_ARCHITECTURES from CMakeLists Set CMP0177 to NEW This upgrades the minimum deployment target for macOS to 12, allowing for builds on macOS 27. CMAKE_OSX_ARCHITECTURES is no longer set in CMakeLists to default to the architecture of the system, which matches most developers' workflows. It will still be set in GHA builds. CMP0177's NEW behavior makes CMake normalize paths, fixing them if needed. This behavior is now set to NEW if the policy is available. --- .github/workflows/build.yml | 3 ++- .github/workflows/release.yml | 3 ++- CMakeLists.txt | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1cf9ef..1cd5382 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,6 +138,7 @@ jobs: - uses: actions/setup-python@v7 with: python-version: '3.12' + cache: 'pip' - name: Install mbedTLS codegen deps run: pip install -r deps/mbedtls/scripts/basic.requirements.txt @@ -145,7 +146,7 @@ jobs: - name: Build and pack Iris run: | git fetch --all --tags - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" cmake --build build sudo cmake --install build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddc3c2e..b814cde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -161,6 +161,7 @@ jobs: - uses: actions/setup-python@v7 with: python-version: '3.12' + cache: 'pip' - name: Install mbedTLS codegen deps run: pip install -r deps/mbedtls/scripts/basic.requirements.txt @@ -168,7 +169,7 @@ jobs: - name: Build and pack Iris run: | git fetch --all --tags - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" cmake --build build sudo cmake --install build diff --git a/CMakeLists.txt b/CMakeLists.txt index c4da37b..adb3900 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,16 @@ cmake_minimum_required(VERSION 3.25) project(iris LANGUAGES C CXX) set(WIN_ICON ${CMAKE_CURRENT_SOURCE_DIR}/res/iris.rc) -set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15") +set(CMAKE_OSX_DEPLOYMENT_TARGET "12") set(OSX_ICON ${CMAKE_CURRENT_SOURCE_DIR}/res/iris.icns) set_source_files_properties(${OSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") +# Normalizing destinations good +if(POLICY CMP0177) + cmake_policy(SET CMP0177 NEW) +endif() + # Statically link SDL3 for Linux targets set(SDL_STATIC ON) set(ASMJIT_STATIC ON) @@ -469,7 +473,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") find_library(MOLTENVK_LIBRARY NAMES libMoltenVK.dylib - PATHS ENV VULKAN_SDK + PATHS /usr/local/lib ENV VULKAN_SDK PATH_SUFFIXES /lib ) From 0647dc0dc38cb1f693d69a188bffee9746310d22 Mon Sep 17 00:00:00 2001 From: Gloria Goertz Date: Tue, 6 Oct 2026 01:25:34 +0200 Subject: [PATCH 2/3] Improve install script Add instructions for installing dependencies with Homebrew --- .gitignore | 2 ++ CMakeLists.txt | 57 ++++++++++++++++++-------------------------------- README.md | 22 ++++++++++++++++--- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 5506882..d9b89c9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,12 @@ tools/ elf/ roms/ .vs/ +.venv/ ac/ screens/ imgui.ini iris.res +*.app *.AppImage *.expected *.dump diff --git a/CMakeLists.txt b/CMakeLists.txt index adb3900..218c592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -524,48 +524,31 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT " message(STATUS "CMake System Name: ${CMAKE_SYSTEM_NAME}") if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - # tell Install about the target, otherwise fixup won't know about the transitive dependencies - install(TARGETS iris - BUNDLE DESTINATION ./install COMPONENT Runtime - RUNTIME DESTINATION ./install/bin COMPONENT Runtime - ) - - set(BUNDLE_PATH "${CMAKE_BINARY_DIR}/iris.app") # where to look for dependencies when fixing up - file(GLOB VULKAN_DYLIBS $ENV{VULKAN_SDK}/lib/libvulkan.*.dylib) - set(VULKAN_DYLIBS ${VULKAN_DYLIBS} $ENV{VULKAN_SDK}/lib/libMoltenVK.dylib) + install(TARGETS iris BUNDLE DESTINATION .) + + set(DIRS "/usr/local/lib") + if(DEFINED ENV{VULKAN_SDK}) + list(APPEND DIRS $ENV{VULKAN_SDK}/lib) + endif() + install(CODE " - execute_process(COMMAND echo \"Preparing to bundle iris...\") - execute_process(COMMAND echo \"Bundle path: ${BUNDLE_PATH}\") - execute_process(COMMAND echo \"Vulkan dylibs: ${VULKAN_DYLIBS}\") - execute_process(COMMAND echo \"Adding local RPATH...\") - execute_process( - COMMAND install_name_tool -add_rpath - \"@executable_path/../Frameworks\" - \"${BUNDLE_PATH}/Contents/MacOS/iris\" - ) - execute_process(COMMAND echo \"Creating ICD JSON directory...\") - make_directory(${BUNDLE_PATH}/Contents/Resources/vulkan/icd.d) - execute_process(COMMAND echo \"Creating Frameworks directory...\") - make_directory(${BUNDLE_PATH}/Contents/Frameworks) - execute_process(COMMAND echo \"Copying files...\") - file(COPY - ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK_icd.json - DESTINATION ${BUNDLE_PATH}/Contents/Resources/vulkan/icd.d/ - ) - file(COPY - ${VULKAN_DYLIBS} - DESTINATION ${BUNDLE_PATH}/Contents/Frameworks/ - ) - execute_process(COMMAND echo \"Signing app bundle...\") - execute_process(COMMAND - codesign --force --deep --sign - ${BUNDLE_PATH} - RESULT_VARIABLE codesign_result - OUTPUT_VARIABLE codesign_output - ) + include(BundleUtilities) + + make_directory($/Contents/Resources/vulkan/icd.d) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK_icd.json DESTINATION $/Contents/Resources/vulkan/icd.d/) + + fixup_bundle($ \"\" \"${DIRS}\") + verify_app($) + + execute_process(COMMAND codesign --force --deep --sign - ${BUNDLE_PATH} RESULT_VARIABLE codesign_result OUTPUT_VARIABLE codesign_output) if (codesign_result) execute_process(COMMAND echo \"${codesign_output}\") endif() ") + + # CMake forgets to copy the signature. I have no idea why + install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/iris.app/Contents/_CodeSignature" DESTINATION "iris.app/Contents") + set(CPACK_GENERATOR "DragNDrop") include(CPack) endif() diff --git a/README.md b/README.md index cf2947a..13ea4e1 100644 --- a/README.md +++ b/README.md @@ -91,14 +91,30 @@ cmake --build build ``` ### macOS - +Install the dependencies, for example with Homebrew: +```sh +brew install cmake ninja python ``` +Then clone: +```sh git clone https://github.com/allkern/iris --recursive cd iris -cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release +``` +mbedTLS uses a Python source generator, which requires some dependencies. You can use a virtual environment to install these locally: +```sh +python3 -m venv .venv +./.venv/bin/pip install -r deps/mbedtls/scripts/basic.requirements.txt +``` +Finally, configure and build: +```sh +cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=$PWD/.venv/bin/python cmake --build build ``` -Optionally run `sudo cmake --install build` to generate a macOS App Bundle +You can also generate a proper Bundle if you'd like: +```sh +cmake --install build --prefix . +``` +You'll then find a full `iris.app` in the project directory. ## Progress/Insights Iris can boot/run a fairly large number of commercial games, playability may be all over the place though, some games run fairly smoothly, while others can't break the 1 digit FPS mark, this is due to the lack of EE/VU JITs which will be addressed soon. From bfc0aaa0b309c7423183f983dbae2b2846b2d8fa Mon Sep 17 00:00:00 2001 From: Gloria Goertz Date: Tue, 6 Oct 2026 03:40:21 +0200 Subject: [PATCH 3/3] Fix macOS' install script --- .github/workflows/build.yml | 18 ++++++------------ .github/workflows/release.yml | 13 ++++++------- CMakeLists.txt | 16 +++++++++------- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1cd5382..04c28ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,31 +148,25 @@ jobs: git fetch --all --tags cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" cmake --build build - sudo cmake --install build + cmake --install build --prefix dist - name: Replace bundled symlinks and re-sign run: | # Artifact zips flatten symlinks into copies, which breaks the # bundle's code signature, so bundle real files and sign those ( - cd ./build/iris.app/Contents/Frameworks + cd dist/iris.app/Contents/Frameworks for f in *; do if [ -L "$f" ]; then target=$(readlink "$f") - sudo rm "$f" - sudo cp "$target" "$f" + rm "$f" + cp "$target" "$f" fi done ) - sudo codesign --force --deep --sign - ./build/iris.app - codesign --verify --deep --strict ./build/iris.app - - - name: Stage artifact - run: | - mkdir -p ./build/dist - cp -R ./build/iris.app ./build/dist + codesign --force --deep --sign - dist/iris.app - uses: actions/upload-artifact@v7 with: name: iris-latest-macos-universal - path: ./build/dist + path: ./dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b814cde..b631a54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,24 +171,23 @@ jobs: git fetch --all --tags cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64" cmake --build build - sudo cmake --install build + cmake --install build --prefix dist - name: Replace bundled symlinks and re-sign run: | # Artifact zips flatten symlinks into copies, which breaks the # bundle's code signature, so bundle real files and sign those ( - cd ./build/iris.app/Contents/Frameworks + cd dist/iris.app/Contents/Frameworks for f in *; do if [ -L "$f" ]; then target=$(readlink "$f") - sudo rm "$f" - sudo cp "$target" "$f" + rm "$f" + cp "$target" "$f" fi done ) - sudo codesign --force --deep --sign - ./build/iris.app - codesign --verify --deep --strict ./build/iris.app + codesign --force --deep --sign - dist/iris.app - name: Generate artifact name id: generate-name @@ -197,7 +196,7 @@ jobs: - name: Zip artifact run: | - cd build; zip -r ../${{ steps.generate-name.outputs.artifact }}.zip ./iris.app; cd .. + zip -r ${{ steps.generate-name.outputs.artifact }}.zip ./dist/ - name: Upload to release uses: softprops/action-gh-release@v3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 218c592..3e7d1ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -524,13 +524,13 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT " message(STATUS "CMake System Name: ${CMAKE_SYSTEM_NAME}") if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - install(TARGETS iris BUNDLE DESTINATION .) - set(DIRS "/usr/local/lib") if(DEFINED ENV{VULKAN_SDK}) list(APPEND DIRS $ENV{VULKAN_SDK}/lib) endif() + # Install prefixes are passed through unnormalized, and fixup_bundle requires a complete path, therefore we need to clobber the bundle in the build folder. + # There's also no way to normalize a path given as a generator expression, like INSTALL_PREFIX. install(CODE " include(BundleUtilities) @@ -538,19 +538,21 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/MoltenVK_icd.json DESTINATION $/Contents/Resources/vulkan/icd.d/) fixup_bundle($ \"\" \"${DIRS}\") - verify_app($) - execute_process(COMMAND codesign --force --deep --sign - ${BUNDLE_PATH} RESULT_VARIABLE codesign_result OUTPUT_VARIABLE codesign_output) + execute_process(COMMAND codesign --force --deep --sign - $ RESULT_VARIABLE codesign_result OUTPUT_VARIABLE codesign_output) if (codesign_result) execute_process(COMMAND echo \"${codesign_output}\") endif() ") - # CMake forgets to copy the signature. I have no idea why - install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/iris.app/Contents/_CodeSignature" DESTINATION "iris.app/Contents") + # BUNDLE installs will try modify the rpath of the bundle, which won't work as fixup_bundle already does so. + install(FILES $ DESTINATION .) + + # FILES installs do not retain the executable flag on binaries. + install(CODE "execute_process(COMMAND /bin/sh -c \"chmod +x $/iris.app/Contents/Frameworks/* $/iris.app/Contents/MacOS/*\")") set(CPACK_GENERATOR "DragNDrop") - include(CPack) + include(CPack) endif() if (CMAKE_SYSTEM_NAME MATCHES "Linux")