Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
46cb798
fix: fix GLFW video mode fallback on startup
elnurvl Aug 28, 2026
80d7b01
fix: fix GLFW mouse activation on startup
elnurvl Aug 28, 2026
743d716
feat: locate macOS game directory when launched from Finder
elnurvl Aug 29, 2026
40198d9
feat: ask the user to choose a game directory if gamefiles could not …
elnurvl Aug 29, 2026
e0a2c43
feat: create an app bundle for macOS builds
elnurvl Aug 29, 2026
b28ba39
feat: resolve gamefiles inside or beside the app bundle
elnurvl Aug 29, 2026
92e8c83
fix: distinguish ARM64 Premake platforms
elnurvl Aug 29, 2026
80c34c8
fix: use libmpg123 pkg-config metadata
elnurvl Aug 29, 2026
6635211
feat: add Xcode support to Premake and CMake
elnurvl Aug 29, 2026
e922ebf
chore: ignore .DS_Store files
elnurvl Aug 29, 2026
046f6e5
fix: center mouse cursor when launching and quitting the game
elnurvl Aug 29, 2026
f7bf1f1
fix: address a TODO comment
elnurvl Aug 30, 2026
65ae7ba
feat: bundle reVC gamefiles as runtime overrides
elnurvl Aug 30, 2026
07fe3c0
feat: use macOS user directories for saves and settings
elnurvl Aug 30, 2026
ad3a5c0
refactor: store macOS game path in reVC.ini
elnurvl Aug 30, 2026
dcb73c2
fix: make Xcode recognize the archive as a macOS app archive
elnurvl Aug 30, 2026
3e7e2f1
fix: enable Hardened Runtime for the Xcode app target
elnurvl Aug 30, 2026
6ef6ce8
fix: support CMake’s Xcode generator on macOS
elnurvl Aug 31, 2026
174c82e
build: remove stale libsndfile linkage
elnurvl Aug 31, 2026
819c241
build: make the app bundle self-contained
elnurvl Aug 31, 2026
da255ed
fix: prevent buffer overflow with long game directory paths
elnurvl Aug 31, 2026
e601184
chore: add application category to Info.plist
elnurvl Aug 31, 2026
d37e3eb
fix: omit missing Homebrew OpenAL search paths when using MacPorts
elnurvl Sep 1, 2026
84ad0e6
refactor: move game path declarations to FileMgr header
elnurvl Sep 1, 2026
d8cb257
build: include the LICENSE file in the app bundle
elnurvl Sep 1, 2026
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# macOS
.DS_Store

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -360,4 +363,4 @@ codewarrior/reVC_Data/
codewarrior/Release/
codewarrior/Debug/

src/extras/GitSHA1.cpp
src/extras/GitSHA1.cpp
137 changes: 137 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ cmake_minimum_required(VERSION 3.14)
set(EXECUTABLE reVC)
set(PROJECT REVC)

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_GENERATOR STREQUAL "Xcode")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "macOS architectures")
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING
"Minimum macOS version" FORCE)
endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "11.0")
set("CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET[arch=arm64]" "11.0")
endif()
elseif(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR
(NOT CMAKE_OSX_ARCHITECTURES AND
CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64"))
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING
"Minimum macOS version" FORCE)
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING
"Minimum macOS version" FORCE)
endif()
endif()
endif()

project(${EXECUTABLE} C CXX)
set(${PROJECT}_AUTHOR "${PROJECT} Team")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
Expand All @@ -11,6 +34,117 @@ include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1 "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")

if(APPLE)
macro(reVC_define_macos_dependency key alias formula library filename)
list(APPEND ${PROJECT}_MACOS_DEPENDENCIES "${key}")
set(${PROJECT}_MACOS_${key}_ALIAS "${alias}")
set(${PROJECT}_MACOS_${key}_FORMULA "${formula}")
set(${PROJECT}_MACOS_${key}_LIBRARY "${library}")
set(${PROJECT}_MACOS_${key}_FILENAME "${filename}")
endmacro()

reVC_define_macos_dependency(OPENAL OpenAL::OpenAL
openal-soft openal libopenal.1.dylib)
reVC_define_macos_dependency(MPG123 MPG123::libmpg123
mpg123 mpg123 libmpg123.0.dylib)
reVC_define_macos_dependency(GLFW glfw
glfw glfw libglfw.3.dylib)

if(CMAKE_GENERATOR STREQUAL "Xcode")
set(${PROJECT}_HOMEBREW_ARM64_PREFIX "/opt/homebrew" CACHE PATH "arm64 Homebrew prefix")
set(${PROJECT}_HOMEBREW_X86_64_PREFIX "/usr/local" CACHE PATH "x86_64 Homebrew prefix")

function(reVC_macos_dependency target alias dylibs formula library filename)
if(EXISTS "/opt/local/lib/${filename}")
add_library(${target} INTERFACE)
add_library(${alias} ALIAS ${target})
target_include_directories(${target} INTERFACE "/opt/local/include")
target_link_libraries(${target} INTERFACE "/opt/local/lib/${filename}")
set(${dylibs} "/opt/local/lib/${filename}" PARENT_SCOPE)
return()
endif()

set(include_prefix)
set(link_options)
set(dependency_dylibs)
foreach(architecture arm64 x86_64)
if(architecture IN_LIST CMAKE_OSX_ARCHITECTURES)
string(TOUPPER "${architecture}" architecture_upper)
set(prefix "${${PROJECT}_HOMEBREW_${architecture_upper}_PREFIX}")
set(dylib "${prefix}/opt/${formula}/lib/${filename}")
if(NOT EXISTS "${dylib}")
message(FATAL_ERROR
"${architecture} ${formula} was not found under ${prefix}"
)
endif()
if(NOT include_prefix)
set(include_prefix "${prefix}")
endif()
list(APPEND dependency_dylibs "${dylib}")
list(APPEND link_options
"SHELL:-Xarch_${architecture} -L${prefix}/opt/${formula}/lib"
)
endif()
endforeach()

add_library(${target} INTERFACE)
add_library(${alias} ALIAS ${target})
target_include_directories(${target} INTERFACE
"${include_prefix}/opt/${formula}/include"
)
target_link_options(${target} INTERFACE ${link_options} "-l${library}")
set(${dylibs} "${dependency_dylibs}" PARENT_SCOPE)
endfunction()

if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES OR
"x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
foreach(dependency IN LISTS ${PROJECT}_MACOS_DEPENDENCIES)
string(TOLOWER "${dependency}" dependency_lower)
reVC_macos_dependency(${PROJECT}_macos_${dependency_lower}
${${PROJECT}_MACOS_${dependency}_ALIAS}
${PROJECT}_MACOS_${dependency}_DYLIBS
${${PROJECT}_MACOS_${dependency}_FORMULA}
${${PROJECT}_MACOS_${dependency}_LIBRARY}
${${PROJECT}_MACOS_${dependency}_FILENAME})
endforeach()
endif()
else()
function(reVC_macos_dependency_dylib output formula filename)
set(prefix "$ENV{HOMEBREW_PREFIX}")
set(candidates "/opt/local/lib/${filename}")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR
(NOT CMAKE_OSX_ARCHITECTURES AND
CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64"))
list(APPEND candidates
"/usr/local/opt/${formula}/lib/${filename}"
)
else()
if(prefix)
list(APPEND candidates "${prefix}/opt/${formula}/lib/${filename}")
endif()
list(APPEND candidates
"/opt/homebrew/opt/${formula}/lib/${filename}"
"/usr/local/opt/${formula}/lib/${filename}"
)
endif()
list(REMOVE_DUPLICATES candidates)
foreach(candidate IN LISTS candidates)
if(EXISTS "${candidate}")
set(${output} "${candidate}" PARENT_SCOPE)
return()
endif()
endforeach()
endfunction()

foreach(dependency IN LISTS ${PROJECT}_MACOS_DEPENDENCIES)
reVC_macos_dependency_dylib(
${PROJECT}_MACOS_${dependency}_DYLIBS
${${PROJECT}_MACOS_${dependency}_FORMULA}
${${PROJECT}_MACOS_${dependency}_FILENAME})
endforeach()
endif()
endif()


if(NINTENDO_SWITCH)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/nx")
Expand Down Expand Up @@ -42,6 +176,9 @@ endif()

option(${PROJECT}_VENDORED_LIBRW "Use vendored librw" ON)
if(${PROJECT}_VENDORED_LIBRW)
if(NOT DEFINED LIBRW_PLATFORM AND NOT PS2)
set(LIBRW_PLATFORM "GL3" CACHE STRING "librw platform")
endif()
add_subdirectory(vendor/librw)
else()
find_package(librw REQUIRED)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Findmpg123.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PKG_MPG123 mpg123)
pkg_search_module(PKG_MPG123 libmpg123)
endif()

find_path(mpg123_INCLUDE_DIR mpg123.h
Expand All @@ -19,7 +19,7 @@ find_path(mpg123_INCLUDE_DIR mpg123.h
)

find_library(mpg123_LIBRARIES NAMES mpg123 mpg123-0 libmpg123-0
HINTS ${PKG_MPG123_LIBRARIES}
HINTS ${PKG_MPG123_LIBRARY_DIRS}
PATHS "${mpg123_DIR}"
PATH_SUFFIXES lib
)
Expand Down
Loading