This commit is contained in:
ZakatTeamI2P 2026-05-23 15:41:03 +04:00
parent 6470bc6e4b
commit 5ed6f9135c
2 changed files with 10 additions and 13 deletions

View file

@ -8,6 +8,7 @@ option(STEAM "Build for Steam" OFF)
set(STEAMWORKS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/steamworks" CACHE PATH "Path to Steamworks folder") set(STEAMWORKS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/steamworks" CACHE PATH "Path to Steamworks folder")
option(DEBUG "Debug mode" ON) option(DEBUG "Debug mode" ON)
set(SDLTTF_VENDORED ON) set(SDLTTF_VENDORED ON)
set(ZLIB_USE_STATIC_LIBS ON)
## Misc setup ## ## Misc setup ##
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -138,14 +139,15 @@ set(MAIN_SOURCE
if(WIN32) if(WIN32)
list(APPEND MAIN_SOURCE assets/resources.rc) list(APPEND MAIN_SOURCE assets/resources.rc)
list(APPEND DEFINES UNICODE) list(APPEND DEFINES UNICODE)
list(APPEND PLATFORM_LIBRARIES Secur32 Shlwapi) list(APPEND PLATFORM_LIBRARIES Secur32 Shlwapi winmm z)
#list(APPEND PLATFORM_LIBS winmm z)
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR}/windows ${CMAKE_CURRENT_BINARY_DIR}/windows
) )
elseif(APPLE) elseif(APPLE)
list(APPEND MAIN_HEADERS src/mac-desktop.h) list(APPEND MAIN_HEADERS src/mac-desktop.h)
list(APPEND MAIN_SOURCE src/mac-desktop.mm) list(APPEND MAIN_SOURCE src/mac-desktop.mm)
else() elseif(LINUX)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(LINUXPKGS REQUIRED gtk+-3.0 libxfconf-0) pkg_check_modules(LINUXPKGS REQUIRED gtk+-3.0 libxfconf-0)
include_directories(${LINUXPKGS_INCLUDE_DIRS}) include_directories(${LINUXPKGS_INCLUDE_DIRS})
@ -306,6 +308,7 @@ add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
${EMBEDDED_SOURCE} ${EMBEDDED_SOURCE}
) )
find_package(ZLIB REQUIRED)
find_package(SDL3 CONFIG) find_package(SDL3 CONFIG)
find_package(SDL3_image CONFIG) find_package(SDL3_image CONFIG)
find_package(SDL3_sound CONFIG) find_package(SDL3_sound CONFIG)
@ -337,11 +340,8 @@ target_include_directories(${PROJECT_NAME}
${SIGC2_INCLUDE_DIRS} ${SIGC2_INCLUDE_DIRS}
${Ruby_INCLUDE_DIRS} ${Ruby_INCLUDE_DIRS}
Boost::boost ${Boost_INCLUDE_DIRS} Boost::boost ${Boost_INCLUDE_DIRS}
${VORBISFILE_INCLUDE_DIRS}) ${VORBISFILE_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS})
if(WIN32)
list(APPEND PLATFORM_LIBS winmm z)
endif()
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
PRIVATE PRIVATE
@ -354,7 +354,7 @@ target_link_libraries(${PROJECT_NAME}
${Ruby_LIBRARIES} ${Ruby_LIBRARIES}
Boost::boost ${Boost_LIBRARIES} Boost::boost ${Boost_LIBRARIES}
${VORBISFILE_LIBRARIES} ${VORBISFILE_LIBRARIES}
ZLIB::ZLIB
${PLATFORM_LIBS} ${PLATFORM_LIBS}
) )

View file

@ -13,7 +13,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3_image/SDL_image.h> #include <SDL3_image/SDL_image.h>
#include <SDL3_ttf/SDL_ttf.h> #include <SDL3_ttf/SDL_ttf.h>
#include <SDL3/SDL_messagebox.h>
// OS-Specific code // OS-Specific code
#if defined _WIN32 #if defined _WIN32
@ -100,7 +100,6 @@ struct linux_DialogData{
static int linux_dialog(void *rawData){ static int linux_dialog(void *rawData){
linux_DialogData *data = reinterpret_cast<linux_DialogData*>(rawData); linux_DialogData *data = reinterpret_cast<linux_DialogData*>(rawData);
// Determine correct flags // Determine correct flags
GtkMessageType gtktype; GtkMessageType gtktype;
GtkButtonsType gtkbuttons = GTK_BUTTONS_OK; GtkButtonsType gtkbuttons = GTK_BUTTONS_OK;
@ -135,8 +134,6 @@ static int linux_dialog(void *rawData){
return 0; return 0;
} }
#elif defined OS_W32 #elif defined OS_W32
/* Convert WCHAR pointer to std::string */ /* Convert WCHAR pointer to std::string */
static std::string w32_fromWide(const WCHAR *ustr){ static std::string w32_fromWide(const WCHAR *ustr){
@ -466,7 +463,7 @@ bool Oneshot::msgbox(int type, const char *body, const char *title){
title = ""; title = "";
#ifdef OS_LINUX #ifdef OS_LINUX
linux_DialogData data = {type, body, title, 0}; linux_DialogData data = {type, body, title, 0};
g_idle_add(linux_dialog, &data); gdk_threads_add_idle(linux_dialog, &data);
gtk_main(); gtk_main();
return data.result; return data.result;
#else #else