updates for windows

master
Michael Fogleman 2014-01-08 20:33:37 -05:00
parent c39394db31
commit 4589f6f102
4 changed files with 11 additions and 4 deletions

View File

@ -26,15 +26,17 @@ include_directories(deps/tinycthread)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})
target_link_libraries(craft glfw ${GLFW_LIBRARIES} ${CURL_LIBRARIES})
if(APPLE)
target_link_libraries(craft glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
if(UNIX)
target_link_libraries(craft dl)
target_link_libraries(craft dl glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
if(WINDOWS)
target_link_libraries(craft ws2_32.lib)
target_link_libraries(craft ws2_32.lib glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

View File

@ -30,6 +30,9 @@ int get_access_token(
long http_code = 0;
snprintf(post, MAX_POST_LENGTH, "username=%s&identity_token=%s",
username, identity_token);
#ifdef _WIN32
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
#endif
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_function);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, response);
curl_easy_setopt(curl, CURLOPT_URL, url);

View File

@ -1,4 +1,5 @@
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#define close closesocket
#define sleep Sleep

View File

@ -1,4 +1,5 @@
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#endif