From 0be8aa09187b1bb1d033b168009c422774b9aa3f Mon Sep 17 00:00:00 2001 From: TurtleP Date: Thu, 14 Sep 2023 14:47:48 -0400 Subject: [PATCH] fix the static linking --- src/CMakeLists.txt | 2 +- src/generic/CurlClient.cpp | 4 ++++ src/lua/{main.cpp => luahttps.cpp} | 0 3 files changed, 5 insertions(+), 1 deletion(-) rename src/lua/{main.cpp => luahttps.cpp} (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8bda2b1..1b9632f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,7 +33,7 @@ endif () ### "Libraries" add_library (https MODULE - lua/main.cpp + lua/luahttps.cpp ) add_library (https-common STATIC diff --git a/src/generic/CurlClient.cpp b/src/generic/CurlClient.cpp index 49d7cb4..61c2055 100644 --- a/src/generic/CurlClient.cpp +++ b/src/generic/CurlClient.cpp @@ -12,12 +12,14 @@ #include #include +#ifndef HTTPS_BACKEND_CURL_LINKED // Dynamic library loader #ifdef _WIN32 #include #else #include #endif +#endif typedef struct StringReader { @@ -25,6 +27,7 @@ typedef struct StringReader size_t pos; } StringReader; +#ifndef HTTPS_BACKEND_CURL_LINKED template static inline bool loadSymbol(T &var, void *handle, const char *name) { @@ -35,6 +38,7 @@ static inline bool loadSymbol(T &var, void *handle, const char *name) #endif return var != nullptr; } +#endif CurlClient::Curl::Curl() : handle(nullptr) diff --git a/src/lua/main.cpp b/src/lua/luahttps.cpp similarity index 100% rename from src/lua/main.cpp rename to src/lua/luahttps.cpp