From a3ed3d48d30af5c096a0b301d0bef384a0b2c22d Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sun, 17 Mar 2024 01:17:58 +0100 Subject: [PATCH] common: fix windows build --- common/CMakeLists.txt | 10 +++++----- common/common.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3beda6d25..cb4e53869 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -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) diff --git a/common/common.cpp b/common/common.cpp index 77b8f1d7c..fd4ee9f1e 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -16,9 +16,6 @@ #include #include #include -#ifdef LLAMA_USE_CURL -#include -#endif #if defined(__APPLE__) && defined(__MACH__) #include @@ -40,6 +37,9 @@ #include #include #endif +#if defined(LLAMA_USE_CURL) +#include +#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 #elif defined(_WIN32)