mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-05-11 03:12:15 +00:00
It builds
This commit is contained in:
parent
c17972c557
commit
fd292fcc2c
4 changed files with 80 additions and 4 deletions
|
|
@ -1,5 +1,12 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(ultramodern)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINUX TRUE)
|
||||
endif()
|
||||
|
||||
add_library(ultramodern STATIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/audio.cpp"
|
||||
|
|
@ -15,10 +22,12 @@ add_library(ultramodern STATIC
|
|||
)
|
||||
|
||||
target_include_directories(ultramodern PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/ultramodern"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/ultramodern" # FIXME: remove redundant path
|
||||
"${CMAKE_SOURCE_DIR}/thirdparty/concurrentqueue"
|
||||
)
|
||||
|
||||
# TODO: remove when rt64 is no longer a hard dependency
|
||||
target_include_directories(ultramodern PRIVATE
|
||||
"${CMAKE_SOURCE_DIR}/rt64/src"
|
||||
"${CMAKE_SOURCE_DIR}/rt64/src/contrib"
|
||||
|
|
@ -28,3 +37,51 @@ target_include_directories(ultramodern PRIVATE
|
|||
"${CMAKE_SOURCE_DIR}/rt64/src/render"
|
||||
"${CMAKE_SOURCE_DIR}/rt64/src/contrib/nativefiledialog-extended/src/include"
|
||||
)
|
||||
|
||||
# TODO: remove when librecomp is untangled from ultramodern
|
||||
target_include_directories(ultramodern PRIVATE
|
||||
"${CMAKE_SOURCE_DIR}/librecomp/include"
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
include(FetchContent)
|
||||
# Fetch SDL2 on windows
|
||||
FetchContent_Declare(
|
||||
sdl2
|
||||
URL https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip
|
||||
URL_HASH MD5=d8173db078e54040c666f411c5a6afff
|
||||
)
|
||||
FetchContent_MakeAvailable(sdl2)
|
||||
target_include_directories(ultramodern PRIVATE
|
||||
${sdl2_SOURCE_DIR}/include
|
||||
)
|
||||
target_link_directories(ultramodern PRIVATE
|
||||
${sdl2_SOURCE_DIR}/lib/x64
|
||||
)
|
||||
|
||||
# Copy SDL2 and dxc DLLs to output folder as post build step
|
||||
add_custom_command(TARGET ultramodern POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${sdl2_SOURCE_DIR}/lib/x64/SDL2.dll"
|
||||
"${CMAKE_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxil.dll"
|
||||
"${CMAKE_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxcompiler.dll"
|
||||
$<TARGET_FILE_DIR:ultramodern>)
|
||||
endif()
|
||||
|
||||
if (LINUX)
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
message(STATUS "SDL2_FOUND = ${SDL2_FOUND}")
|
||||
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
|
||||
|
||||
target_include_directories(ultramodern PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
|
||||
message(STATUS "X11_FOUND = ${X11_FOUND}")
|
||||
message(STATUS "X11_Xrandr_FOUND = ${X11_Xrandr_FOUND}")
|
||||
message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
|
||||
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
|
||||
|
||||
target_include_directories(ultramodern PRIVATE ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
|
||||
target_link_libraries(ultramodern PRIVATE ${X11_LIBRARIES} ${X11_Xrandr_LIB})
|
||||
endif()
|
||||
|
|
|
|||
15
ultramodern/include/ultramodern/recomp_ui.h
Normal file
15
ultramodern/include/ultramodern/recomp_ui.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef __ULTRAMODERN_RECOMP_UI__
|
||||
#define __ULTRAMODERN_RECOMP_UI__
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace recomp {
|
||||
// Currently those functions are expected to be provided by the consumer of this library.
|
||||
// TODO: Change these functions to a callback registering system
|
||||
|
||||
void destroy_ui();
|
||||
void update_supported_options();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
#include "rt64_layer.h"
|
||||
#include "recomp.h"
|
||||
#include "recomp_game.h"
|
||||
#include "recomp_ui.h"
|
||||
#include "ultramodern/recomp_ui.h"
|
||||
#include "recomp_input.h"
|
||||
#include "rsp.h"
|
||||
|
||||
|
|
@ -325,7 +325,7 @@ void gfx_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_re
|
|||
|
||||
// TODO move recomp code out of ultramodern.
|
||||
recomp::update_supported_options();
|
||||
|
||||
|
||||
rsp_constants_init();
|
||||
|
||||
// Notify the caller thread that this thread is ready.
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ ultramodern::RT64SetupResult map_setup_result(RT64::Application::SetupResult rt6
|
|||
case RT64::Application::SetupResult::GraphicsDeviceNotFound:
|
||||
return ultramodern::RT64SetupResult::GraphicsDeviceNotFound;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Unhandled `RT64::Application::SetupResult` ?\n");
|
||||
assert(false);
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ultramodern::RT64Context::RT64Context(uint8_t* rdram, ultramodern::WindowHandle window_handle, bool debug) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue