Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,16 @@ jobs:
path: artifacts

build-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
arch: x64
- os: windows-11-arm
arch: arm64
name: build-windows-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v6
Expand Down Expand Up @@ -190,19 +199,19 @@ jobs:
shell: cmd
run: |
cd src\resource
makensis /DPRODUCT_VERSION=${{ inputs.next_version_major }}.${{ inputs.next_version_minor }} installer.nsi
makensis /DPRODUCT_VERSION=${{ inputs.next_version_major }}.${{ inputs.next_version_minor }} /DARCH=${{ matrix.arch }} installer.nsi

- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: cemu-bin-windows-x64
name: cemu-bin-windows-${{ matrix.arch }}
path: ./bin/Cemu.exe

- name: Upload NSIS Installer
uses: actions/upload-artifact@v6
with:
name: cemu-installer-windows-x64
path: ./src/resource/cemu-${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}-windows-x64-installer.exe
name: cemu-installer-windows-${{ matrix.arch }}
path: ./src/resource/cemu-${{ inputs.next_version_major }}.${{ inputs.next_version_minor }}-windows-${{ matrix.arch }}-installer.exe

build-macos:
runs-on: macos-14
Expand Down
32 changes: 30 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ if (ENABLE_VCPKG)
# CONFIG option
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
if (WIN32)
set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "")
endif()
message(STATUS "CPU Arch is: $ENV{PROCESSOR_ARCHITECTURE}")
if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "x86_64|amd64|AMD64")
Comment on lines +54 to +55

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use CEMU_ARCHITECTURE for consistency

set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "" FORCE)
set(VCPKG_HOST_TRIPLET "x64-windows-static" CACHE STRING "" FORCE)
else()
set(VCPKG_TARGET_TRIPLET "arm64-windows-static" CACHE STRING "" FORCE)
set(VCPKG_HOST_TRIPLET "arm64-windows-static" CACHE STRING "" FORCE)
endif()
message(STATUS "Using VCPKG triplet: ${VCPKG_TARGET_TRIPLET}")
endif()
endif()

project(Cemu VERSION 2.0.0)
Expand All @@ -79,6 +87,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
# floating point model: precise, fiber safe optimizations
add_compile_definitions(NOMINMAX)
add_compile_options(/EHsc /fp:precise)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Speeds up static linking (especially helpful in incremental compilation)
Expand Down Expand Up @@ -173,6 +182,19 @@ if (NOT TARGET glslang::SPIRV AND TARGET SPIRV)
add_library(glslang::SPIRV ALIAS SPIRV)
endif()

if (UNIX AND NOT APPLE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(ARCH_TRIPLET "aarch64-linux-gnu")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(ARCH_TRIPLET "x86_64-linux-gnu")
else()
message(WARNING "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
if(ARCH_TRIPLET)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/share/pkgconfig:/usr/lib/${ARCH_TRIPLET}/pkgconfig:/usr/local/share/pkgconfig")
endif()
endif()

if (UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
if (ENABLE_WAYLAND)
Expand Down Expand Up @@ -253,6 +275,9 @@ if (ENABLE_CUBEB)
endif()

add_subdirectory("dependencies/ih264d" EXCLUDE_FROM_ALL)
if(MSVC)
target_compile_options(ih264d PRIVATE /wd4005)
endif()

if (CMAKE_OSX_ARCHITECTURES)
set(CEMU_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES})
Expand All @@ -261,6 +286,9 @@ else()
endif()
if(CEMU_ARCHITECTURE MATCHES "(aarch64)|(AARCH64)|(arm64)|(ARM64)")
add_subdirectory("dependencies/xbyak_aarch64" EXCLUDE_FROM_ALL)
if(MSVC)
set_target_properties(xbyak_aarch64 PROPERTIES COMPILE_FLAGS "/wd4245 /wd4458")
Comment thread
qurious-pixel marked this conversation as resolved.
Outdated
endif()
endif()

find_package(ZArchive QUIET)
Expand Down
12 changes: 10 additions & 2 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"configurations": [
{
"name": "RelWithDebInfo",
Expand All @@ -16,6 +16,14 @@
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}"
},
{
"name": "ARM64-Release",
"configurationType": "Release",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_arm64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}"
},
Comment on lines +19 to +26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's different in this vs. Release? CMake configs should be compatible cross platforms

{
"name": "Debug",
"configurationType": "Debug",
Expand All @@ -25,4 +33,4 @@
"installRoot": "${projectDir}\\out\\install\\${name}"
}
]
}
}
Loading