@@ -136,6 +136,10 @@ set(CMAKE_C_FLAGS_DEBUG "-g -ffast-math -DDEBUG")
136136set (CMAKE_CXX_FLAGS_DEBUG "-g -ffast-math -DDEBUG" )
137137set (CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG" )
138138set (CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG" )
139+ add_compile_definitions (
140+ _LARGEFILE64_SOURCE=1
141+ _POSIX_C_SOURCE=200809L
142+ )
139143else ()
140144set (CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG" )
141145set (CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG" )
@@ -153,7 +157,6 @@ add_compile_definitions(
153157 ENABLE_RUMBLE=1
154158 F3D_OLD=1
155159 F3D_GBI=1
156- USE_GBI_TRACE=1
157160 GBI_FLOATS=1
158161 _LANGUAGE_C
159162 _USE_MATH_DEFINES
@@ -300,13 +303,27 @@ endif()
300303# Libultraship Integration #
301304#==============================================================================#
302305
306+ # Removes MPQ/OTR support
307+ set (EXCLUDE_MPQ_SUPPORT TRUE CACHE BOOL "" )
308+ set (ENABLE_EXP_AUTO_CONFIGURE_CONTROLLERS ON CACHE BOOL "" )
309+ add_compile_definitions (EXCLUDE_MPQ_SUPPORT )
310+
311+ if (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch" )
312+ find_package (SDL2 )
313+ endif ()
314+
315+ include_directories (
316+ ${CMAKE_CURRENT_SOURCE_DIR }
317+ ${CMAKE_CURRENT_SOURCE_DIR } /libultraship/include
318+ ${CMAKE_CURRENT_SOURCE_DIR } /libultraship/include/libultraship
319+ ${SDL2_INCLUDE_DIRS}
320+ ${GLEW_INCLUDE_DIRS}
321+ ${dr_libs_SOURCE_DIR }
322+ )
323+
303324add_subdirectory (libultraship ${CMAKE_CURRENT_SOURCE_DIR } /libultraship )
304325add_dependencies (${PROJECT_NAME } libultraship )
305326target_link_libraries (${PROJECT_NAME } PRIVATE libultraship )
306- target_include_directories (${PROJECT_NAME } PRIVATE
307- ${CMAKE_CURRENT_SOURCE_DIR } /libultraship/include
308- ${CMAKE_CURRENT_SOURCE_DIR } /libultraship/include/libultraship
309- )
310327
311328if (${CMAKE_SYSTEM_NAME } STREQUAL "iOS" )
312329 get_property (IOS_TOOLCHAIN_FILE GLOBAL PROPERTY IOS_TOOLCHAIN_FILE)
@@ -397,19 +414,7 @@ if(USE_NETWORKING)
397414 target_compile_definitions (${PROJECT_NAME } PRIVATE USE_NETWORKING )
398415endif ()
399416
400- option (USE_STANDALONE "Build as a standalone executable" OFF )
401- option (BUILD_STORMLIB "Build with StormLib support" OFF )
402-
403- option (BUILD_SM64 "Build with Super Mario 64 support" ON )
404- option (BUILD_MK64 "Build with Mario Kart 64 support" OFF )
405- option (BUILD_SF64 "Build with Star Fox 64 support" OFF )
406- option (BUILD_FZERO "Build with F-Zero X support" OFF )
407- option (BUILD_MARIO_ARTIST "Build with Mario Artist support" OFF )
408- add_subdirectory (Torch )
409- target_link_libraries (${PROJECT_NAME } PRIVATE torch "${ADDITIONAL_LIBRARY_DEPENDENCIES} " )
410-
411417if (CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch" )
412-
413418nx_generate_nacp (${PROJECT_NAME } .nacp
414419 NAME "${PROJECT_NAME } "
415420 AUTHOR "${PROJECT_TEAM} "
@@ -422,8 +427,20 @@ nx_create_nro(${PROJECT_NAME}
422427)
423428
424429INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR } /${PROJECT_NAME } .nro DESTINATION . COMPONENT ${PROJECT_NAME } )
430+ else ()
431+ option (USE_STANDALONE "Build as a standalone executable" OFF )
432+ option (BUILD_STORMLIB "Build with StormLib support" OFF )
433+
434+ option (BUILD_SM64 "Build with Super Mario 64 support" ON )
435+ option (BUILD_MK64 "Build with Mario Kart 64 support" OFF )
436+ option (BUILD_SF64 "Build with Star Fox 64 support" OFF )
437+ option (BUILD_FZERO "Build with F-Zero X support" OFF )
438+ option (BUILD_MARIO_ARTIST "Build with Mario Artist support" OFF )
439+ add_subdirectory (Torch )
440+ list (APPEND ADDITIONAL_LIBRARY_DEPENDENCIES torch)
425441endif ()
426442
443+ target_link_libraries (${PROJECT_NAME } PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES} " )
427444################################################################################
428445# Compile and link options
429446################################################################################
@@ -518,7 +535,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
518535 -Wno-missing-braces
519536 -Wno-int-conversion
520537 $<$<COMPILE_LANGUAGE :C >:
521- -Werror -implicit -function -declaration
538+ -Wno -implicit -function -declaration
522539 -Wno -incompatible -pointer -types
523540 -fpermissive
524541 >
0 commit comments