add libcurl
This commit is contained in:
parent
a17314d5e0
commit
cb925d005c
2
.github/workflows/appimage.yml
vendored
2
.github/workflows/appimage.yml
vendored
@ -2,7 +2,7 @@ name: C/C++ AppImage
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "release-**"]
|
branches: [ "main", "release-**", "curl"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@ -2,7 +2,7 @@ name: Macos Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "release-**"]
|
branches: [ "main", "release-**", "curl"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@ -2,7 +2,7 @@ name: Windows Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "release-**"]
|
branches: [ "main", "release-**", "curl"]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ find_package(GLEW REQUIRED)
|
|||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
|
find_package(CURL REQUIRED)
|
||||||
if (NOT APPLE)
|
if (NOT APPLE)
|
||||||
find_package(EnTT REQUIRED)
|
find_package(EnTT REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
@ -61,5 +62,6 @@ if(UNIX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${LUA_INCLUDE_DIR})
|
include_directories(${LUA_INCLUDE_DIR})
|
||||||
|
include_directories(${CURL_INCLUDE_DIR})
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB PNG::PNG ${VORBISLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS})
|
target_link_libraries(${PROJECT_NAME} ${LIBS} glfw OpenGL::GL ${OPENAL_LIBRARY} GLEW::GLEW ZLIB::ZLIB PNG::PNG CURL::libcurl ${VORBISLIB} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||||
|
|||||||
18
test/curltest.cpp
Normal file
18
test/curltest.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) {
|
||||||
|
return size * nmemb;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(curltest, curltest) {
|
||||||
|
if (CURL* curl = curl_easy_init()) {
|
||||||
|
CURLcode res;
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "https://github.com");
|
||||||
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
std::cout << curl_easy_strerror(res) << std::endl;
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@
|
|||||||
"luajit",
|
"luajit",
|
||||||
"libvorbis",
|
"libvorbis",
|
||||||
"entt",
|
"entt",
|
||||||
"gtest"
|
"gtest",
|
||||||
|
"curl"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user