Skip to content
Snippets Groups Projects
Commit ca1dfac9 authored by Stephen Hurd's avatar Stephen Hurd
Browse files

Smore more Win32 fixes

Sketchiest thing is using _mkgmtime32 instead of _mkgmtime...
This is aliased on Vista or above, but apparently we're not targeting that?
parent 84168c9b
No related branches found
No related tags found
No related merge requests found
......@@ -53,14 +53,16 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
endif()
if(X11_FOUND)
list(APPEND SOURCE x_events.c x_cio.c scale.c)
list(APPEND SOURCE x_events.c x_cio.c)
set(NEED_BITMAP TRUE)
set(NEED_DLOPEN TRUE)
set(NEED_SCALE TRUE)
endif()
if(SDL2_FOUND)
if(SDL2_INCLUDE_DIRS)
list(APPEND SOURCE sdl_con.c)
list(APPEND SOURCE sdlfuncs.c)
set(NEED_SCALE TRUE)
if(WIN32)
list(APPEND SOURCE SDL_win32_main.c)
endif()
......@@ -75,6 +77,10 @@ if(NEED_BITMAP)
list(APPEND SOURCE bitmap_con.c)
endif()
if(NEED_SCALE)
list(APPEND SOURCE scale.c)
endif()
add_library(ciolib OBJECT ${SOURCE})
target_include_directories(ciolib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
......@@ -84,8 +90,8 @@ else()
target_compile_definitions(ciolib PRIVATE NO_X)
endif()
if(SDL2_FOUND)
target_include_directories(ciolib PRIVATE ${SDL2_INCLUDE_DIRS})
if(SDL2_INCLUDE_DIRS)
target_include_directories(ciolib PUBLIC ${SDL2_INCLUDE_DIRS})
set(WITH_SDL TRUE PARENT_SCOPE)
endif()
......
......@@ -114,6 +114,7 @@ struct tm* localtime32(const time32_t* t32, struct tm* tm)
#if defined(_WIN32)
#include <windows.h> /* SYSTEMTIME and GetLocalTime() */
#include <time.h> /* _mkgmtime */
#else
#include <sys/time.h> /* stuct timeval, gettimeofday() */
#endif
......
......@@ -57,7 +57,7 @@ DLLEXPORT struct tm* localtime32(const time32_t* t, struct tm* tm);
/* Microsoft's equivalent of GLIBC/BSD timegm() */
#if defined(_MSC_VER) || defined(__MINGW32__)
#define timegm _mkgmtime
#define timegm _mkgmtime32
#endif
/***********************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment