Merge commit 'a1c2940b31' into torzu-merging

This commit is contained in:
marius david 2025-01-01 19:19:00 +01:00
commit 18220cb4d4
2 changed files with 51 additions and 46 deletions

View file

@ -58,6 +58,8 @@ option(SUYU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android"
CMAKE_DEPENDENT_OPTION(SUYU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF)
option(SUZU_CMD "Compile the -cmd executable (can disable if -cmd is unused)" ON)
CMAKE_DEPENDENT_OPTION(SUYU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
option(SUYU_USE_BUNDLED_VCPKG "Use vcpkg for suyu dependencies" "${MSVC}")

View file

@ -12,54 +12,57 @@ function(create_resource file output filename)
file(WRITE "${PROJECT_BINARY_DIR}/dist/${output}" "const unsigned char ${filename}[] = {${filedata}};\nconst unsigned ${filename}_size = sizeof(${filename});\n")
endfunction()
add_executable(suyu-cmd
emu_window/emu_window_sdl2.cpp
emu_window/emu_window_sdl2.h
emu_window/emu_window_sdl2_gl.cpp
emu_window/emu_window_sdl2_gl.h
emu_window/emu_window_sdl2_null.cpp
emu_window/emu_window_sdl2_null.h
emu_window/emu_window_sdl2_vk.cpp
emu_window/emu_window_sdl2_vk.h
precompiled_headers.h
sdl_config.cpp
sdl_config.h
suyu.cpp
suyu.rc
)
if (SUZU_CMD)
add_executable(suyu-cmd
emu_window/emu_window_sdl2.cpp
emu_window/emu_window_sdl2.h
emu_window/emu_window_sdl2_gl.cpp
emu_window/emu_window_sdl2_gl.h
emu_window/emu_window_sdl2_null.cpp
emu_window/emu_window_sdl2_null.h
emu_window/emu_window_sdl2_vk.cpp
emu_window/emu_window_sdl2_vk.h
precompiled_headers.h
sdl_config.cpp
sdl_config.h
suyu.cpp
suyu.rc
)
target_link_libraries(suyu-cmd PRIVATE common core input_common frontend_common)
target_link_libraries(suyu-cmd PRIVATE glad)
if (MSVC)
target_link_libraries(suyu-cmd PRIVATE getopt)
endif()
target_link_libraries(suyu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
create_resource("../../dist/suyu.bmp" "suyu_cmd/suyu_icon.h" "suyu_icon")
target_include_directories(suyu-cmd PRIVATE ${RESOURCES_DIR})
target_link_libraries(suyu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
if(UNIX AND NOT APPLE)
install(TARGETS suyu-cmd)
endif()
if(WIN32)
# compile as a win32 gui application instead of a console application
if(MSVC)
set_target_properties(suyu-cmd PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
elseif(MINGW)
set_target_properties(suyu-cmd PROPERTIES LINK_FLAGS_RELEASE "-Wl,--subsystem,windows")
target_link_libraries(suyu-cmd PRIVATE common core input_common frontend_common)
target_link_libraries(suyu-cmd PRIVATE glad)
if (MSVC)
target_link_libraries(suyu-cmd PRIVATE getopt)
endif()
endif()
target_link_libraries(suyu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
if (MSVC)
include(CopySuyuSDLDeps)
copy_suyu_SDL_deps(suyu-cmd)
endif()
create_resource("../../dist/suyu.bmp" "suyu_cmd/suyu_icon.h" "suyu_icon")
target_include_directories(suyu-cmd PRIVATE ${RESOURCES_DIR})
if (SUYU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(suyu-cmd PRIVATE precompiled_headers.h)
endif()
target_link_libraries(suyu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
create_target_directory_groups(suyu-cmd)
if(UNIX AND NOT APPLE)
install(TARGETS suyu-cmd)
endif()
if(WIN32)
# compile as a win32 gui application instead of a console application
if(MSVC)
set_target_properties(suyu-cmd PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
elseif(MINGW)
set_target_properties(suyu-cmd PROPERTIES LINK_FLAGS_RELEASE "-Wl,--subsystem,windows")
endif()
target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
endif()
if (MSVC)
include(CopySuyuSDLDeps)
copy_suyu_SDL_deps(suyu-cmd)
endif()
if (SUYU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(suyu-cmd PRIVATE precompiled_headers.h)
endif()
create_target_directory_groups(suyu-cmd)
endif()