1
0

Initial commit

This commit is contained in:
2023-08-29 02:06:18 +00:00
commit 0b55bf645c
10 changed files with 527 additions and 0 deletions

42
CMakeLists.txt Normal file
View File

@@ -0,0 +1,42 @@
cmake_minimum_required(VERSION 3.15)
set(CMAKE_BUILD_TYPE Release)
include(CMakeDependentOption)
cmake_dependent_option(USE_D3D11 "use d3d11" OFF "WIN32" OFF)
set(RENDER_DRIVER USE_OPENGL)
if (USE_D3D11)
set(RENDER_DRIVER USE_D3D11)
message(STATUS "Use D3D11")
else ()
message(STATUS "Use OpenGL")
endif ()
if (MPV_SW_RENDER)
list(APPEND RENDER_DRIVER MPV_SW_RENDER)
endif ()
project(xplayer)
set(MAIN_SRC "src/main.cpp")
add_executable(xplayer ${MAIN_SRC})
set_target_properties(xplayer PROPERTIES CXX_STANDARD 17)
target_include_directories(xplayer PRIVATE ${CMAKE_SOURCE_DIR})
target_compile_definitions(xplayer PRIVATE ${RENDER_DRIVER})
if (NINTENDO_SWITCH)
target_link_libraries(xplayer
PRIVATE
sdl2 glapi drm_nouveau nx m
)
nx_generate_nacp(xplayer.nacp NAME "xplayer demo" AUTHOR dragonflylee VERSION 1.0)
nx_create_nro(xplayer ICON ${CMAKE_SOURCE_DIR}/icon.jpg NACP xplayer.nacp)
else ()
find_package(SDL2 REQUIRED)
if (MINGW)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
endif ()
target_link_libraries(xplayer PRIVATE ${SDL2_LIBRARIES})
endif ()