From d0b461264f7f7340f8862772a95a861754b11985 Mon Sep 17 00:00:00 2001 From: DepressedTWM Date: Fri, 12 Jun 2026 10:46:40 -0400 Subject: [PATCH] *BSD support --- CMakeLists.txt | 10 +++++----- src/config.cpp | 3 +-- src/main.cpp | 4 ++-- src/sharedstate.h | 1 - 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63c25bc..c194a25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,16 +355,16 @@ find_package(Ruby 3.0 REQUIRED COMPONENTS Development) pkg_check_modules(VORBISFILE REQUIRED vorbisfile) find_package_handle_standard_args(pixman-1 DEFAULT_MSG PIXMAN_LIBRARY PIXMAN_INCLUDE_DIR) mark_as_advanced(PIXMAN_INCLUDE_DIR PIXMAN_LIBRARY) -if(!EMSCRIPTEN) +if(EMSCRIPTEN) + +else() find_package(OpenSSL CONFIG REQUIRED COMPONENTS Crypto) pkg_check_modules(SIGC2 REQUIRED sigc++-2.0) pkg_check_modules(LIBZIP REQUIRED libzip) endif() -target_compile_definitions(${PROJECT_NAME} - PRIVATE - ${DEFINES}) +target_compile_definitions(${PROJECT_NAME} PRIVATE ${DEFINES}) -if(!EMSCRIPTEN) +if(EMSCRIPTEN) target_include_directories(${PROJECT_NAME} PRIVATE src include ${PIXMAN_INCLUDE_DIR} ${Ruby_INCLUDE_DIRS} Boost::boost ${Boost_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}) diff --git a/src/config.cpp b/src/config.cpp index 7992473..f2c5514 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -133,8 +133,7 @@ void Config::read(int argc, char *argv[]){ try{ po::parsed_options cmdPo = po::command_line_parser(argc, argv).options(podesc).run(); po::store(cmdPo, vm); - } - catch (po::error &error){ + }catch (po::error &error){ Debug() << "[config] Command line:" << error.what(); } diff --git a/src/main.cpp b/src/main.cpp index f30d556..49c121d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -226,7 +226,7 @@ int main(int argc, char *argv[]){ SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, "Game"); //X11 work on *BSD,Solaris too! #if defined(__linux__) || defined(BSD) || defined(__sun) - SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); + SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); #if SDL_VERSION_ATLEAST(3, 4, 10) SDL_SetHint(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, "1"); #endif @@ -331,7 +331,7 @@ int main(int argc, char *argv[]){ /* OSX and Windows have their own native ways of * dealing with icons; don't interfere with them */ -#ifdef __LINUX__ +#ifdef defined(__linux__) || defined(BSD) setupWindowIcon(conf, win); #elif __EMSCRIPTEN__ Debug() << "meow"; diff --git a/src/sharedstate.h b/src/sharedstate.h index 1e562d8..ffba243 100644 --- a/src/sharedstate.h +++ b/src/sharedstate.h @@ -22,7 +22,6 @@ #ifndef SHAREDSTATE_H #define SHAREDSTATE_H -// #include #include #define shState SharedState::instance