common: fix windows build

This commit is contained in:
Pierrick HYMBERT 2024-03-17 01:17:58 +01:00
parent 73b4b44785
commit a3ed3d48d3
2 changed files with 9 additions and 9 deletions

View file

@ -68,14 +68,14 @@ if (BUILD_SHARED_LIBS)
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
target_include_directories(${TARGET} PUBLIC .)
target_compile_features(${TARGET} PUBLIC cxx_std_11)
target_link_libraries(${TARGET} PRIVATE build_info PUBLIC llama)
# Use curl to download model url
if (LLAMA_CURL)
find_package(CURL)
add_definitions(-DLLAMA_USE_CURL)
target_include_directories(${TARGET} ${CURL_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(${TARGET} PRIVATE curl)
endif ()
target_include_directories(${TARGET} PUBLIC .)
target_compile_features(${TARGET} PUBLIC cxx_std_11)
target_link_libraries(${TARGET} PRIVATE build_info PUBLIC llama)

View file

@ -16,9 +16,6 @@
#include <unordered_set>
#include <vector>
#include <cinttypes>
#ifdef LLAMA_USE_CURL
#include <curl/curl.h>
#endif
#if defined(__APPLE__) && defined(__MACH__)
#include <sys/types.h>
@ -40,6 +37,9 @@
#include <sys/stat.h>
#include <unistd.h>
#endif
#if defined(LLAMA_USE_CURL)
#include <curl/curl.h>
#endif
#if defined(_MSC_VER)
#pragma warning(disable: 4244 4267) // possible loss of data
@ -53,7 +53,7 @@
#define GGML_USE_CUBLAS_SYCL_VULKAN
#endif
#ifdef LLAMA_USE_CURL
#if defined(LLAMA_USE_CURL)
#ifdef __linux__
#include <linux/limits.h>
#elif defined(_WIN32)