diff --git a/CMakeLists.txt b/CMakeLists.txt index 7771c04..054db11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,14 @@ if(NOT FXLINK_DISABLE_UDISKS2) pkg_check_modules(udisks2 REQUIRED udisks2 IMPORTED_TARGET) endif() if(NOT FXLINK_DISABLE_SDL2) - pkg_check_modules(sdl2 REQUIRED sdl2 IMPORTED_TARGET) + if(WIN32) + set(SDL2_NO_MWINDOWS 1) + find_package(SDL2 REQUIRED) + else() + pkg_check_modules(sdl2 REQUIRED sdl2 IMPORTED_TARGET) + set(SDL2_LIBRARIES PkgConfig::sdl2) + set(SDL2_INCLUDE_DIRS) + endif() endif() pkg_check_modules(ncurses REQUIRED ncursesw IMPORTED_TARGET) @@ -87,7 +94,8 @@ if(NOT FXLINK_DISABLE_UDISKS2) target_link_libraries(fxlink PkgConfig::udisks2) endif() if(NOT FXLINK_DISABLE_SDL2) - target_link_libraries(fxlink PkgConfig::sdl2) + target_link_libraries(fxlink ${SDL2_LIBRARIES}) + target_include_directories(fxlink PRIVATE ${SDL2_INCLUDE_DIRS}) endif() # fxsdk-gdb-bridge diff --git a/fxlink/main.c b/fxlink/main.c index 9db1a64..3bd04b5 100644 --- a/fxlink/main.c +++ b/fxlink/main.c @@ -16,6 +16,11 @@ #include #include +#ifndef FXLINK_DISABLE_SDL2 +/* Grab main()-related macros */ +#include +#endif + static const char *help_string = "usage: %1$s (-l|-b|-t) [General options]\n" " %1$s -i [-r] [--fxlink-log[=]] [General options]\n"