Get the core to build for Switch, minus networking

This commit is contained in:
Jesse Talavera-Greenberg 2023-10-10 20:24:57 -04:00
parent 29c84c6fee
commit d056183502
4 changed files with 11 additions and 1 deletions

View File

@ -129,6 +129,7 @@ endif ()
if (NINTENDO_SWITCH OR (${CMAKE_SYSTEM_NAME} STREQUAL "NintendoSwitch"))
set(HAVE_LIBNX ON)
set(SWITCH ON)
message(STATUS "Building for Nintendo Switch")
endif()
@ -240,6 +241,10 @@ function(add_common_definitions TARGET)
if (HAVE_ZLIB)
target_compile_definitions(${TARGET} PUBLIC HAVE_ZLIB)
endif ()
if (SWITCH)
target_compile_definitions(${TARGET} PUBLIC SWITCH __SWITCH__)
endif ()
endfunction()
# TODO: Detect if SSL is available; if so, define HAVE_SSL

View File

@ -135,6 +135,8 @@ if (HAVE_ZLIB)
${libretro-common_SOURCE_DIR}/streams/trans_stream_zlib.c
)
target_link_libraries(libretro-common PUBLIC zlibstatic)
target_include_directories(libretro-common SYSTEM PUBLIC ${zlib_SOURCE_DIR})
target_include_directories(libretro-common PUBLIC ${zlib_BINARY_DIR})
endif ()
set_target_properties(libretro-common PROPERTIES PREFIX "" OUTPUT_NAME "libretro-common")

View File

@ -884,7 +884,7 @@ static void melonds::config::parse_audio_options() noexcept {
}
}
#ifdef HAVE_NETWORKING
static void melonds::config::parse_network_options() noexcept {
ZoneScopedN("melonds::config::parse_network_options");
using retro::get_variable;
@ -896,6 +896,7 @@ static void melonds::config::parse_network_options() noexcept {
net::_networkMode = NetworkMode::Indirect;
}
}
#endif
static bool melonds::config::parse_video_options(bool initializing) noexcept {
ZoneScopedN("melonds::config::parse_video_options");

View File

@ -101,6 +101,7 @@ int Platform::LAN_RecvPacket(u8 *data) {
}
}
#ifdef HAVE_DYLIB
Platform::DynamicLibrary *Platform::DynamicLibrary_Load(const char *lib) {
ZoneScopedN("Platform::DynamicLibrary_Load");
return static_cast<DynamicLibrary *>(dylib_load(lib));
@ -115,3 +116,4 @@ void *Platform::DynamicLibrary_LoadFunction(Platform::DynamicLibrary *lib, const
ZoneScopedN("Platform::DynamicLibrary_LoadFunction");
return reinterpret_cast<void *>(dylib_proc(lib, name));
}
#endif