"various changes to get it building for mac, as well as 64-bit" from zestydev

This commit is contained in:
dbalatoni13 2025-04-04 04:05:31 +02:00
parent ed2a2225d7
commit caea40c6aa
11 changed files with 216 additions and 162 deletions

View file

@ -1,8 +1,18 @@
cmake_minimum_required(VERSION 3.13)
if (APPLE)
project(marioparty4 LANGUAGES C CXX OBJC)
else ()
project(marioparty4 LANGUAGES C CXX)
endif ()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
# Set build type to Debug if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -fsanitize=address -fsanitize-address-use-after-scope")
@ -12,6 +22,10 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX 32)
endif ()
if(APPLE)
add_compile_options(-Wno-declaration-after-statement)
endif ()
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
add_subdirectory(extern/musyx EXCLUDE_FROM_ALL)
@ -52,6 +66,15 @@ source_group("Dolphin" FILES ${DOLPHIN_FILES})
source_group("Game" FILES ${GAME_FILES})
source_group("Port" FILES ${PORT_FILES})
if (NOT MSVC)
foreach(file ${DOLPHIN_FILES})
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-std=c89 -Dinline=")
endforeach()
foreach(file ${GAME_FILES})
set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "-std=c89 -Dinline=")
endforeach()
endif ()
add_executable(marioparty4 ${DOLPHIN_FILES} ${GAME_FILES} ${PORT_FILES})
target_compile_definitions(marioparty4 PRIVATE TARGET_PC VERSION=0)
target_compile_definitions(musyx PRIVATE MUSY_VERSION_MAJOR=1 MUSY_VERSION_MINOR=5 MUSY_VERSION_PATCH=4)