updates for windows
parent
c39394db31
commit
4589f6f102
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#define close closesocket
|
||||
#define sleep Sleep
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue