Fix library when using use_http=OFF (gh#622)

This commit is contained in:
Ewerton Scaboro da Silva 2023-05-16 14:42:56 -07:00
Родитель 4d50d92255
Коммит 73948b3ea6
3 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -276,6 +276,8 @@ if(${use_http})
./src/httpheaders.c
${HTTP_C_FILE}
)
else()
add_definitions(-DHTTP_DISABLED)
endif()
if(${use_schannel})

Просмотреть файл

@ -31,11 +31,13 @@ int platform_init(void)
{
int result = 0;
#ifndef DONT_USE_UPLOADTOBLOB
#if !defined(HTTP_DISABLED)
if (HTTPAPIEX_Init() == HTTPAPIEX_ERROR)
{
LogError("HTTP for upload to blob failed on initialization.");
result = MU_FAILURE;
}
#endif /* HTTP_DISABLED */
#endif /* DONT_USE_UPLOADTOBLOB */
#ifdef USE_OPENSSL
if (result == 0)
@ -92,7 +94,9 @@ STRING_HANDLE platform_get_platform_info(PLATFORM_INFO_OPTION options)
void platform_deinit(void)
{
#ifndef DONT_USE_UPLOADTOBLOB
#if !defined(HTTP_DISABLED)
HTTPAPIEX_Deinit();
#endif /* HTTP_DISABLED */
#endif /* DONT_USE_UPLOADTOBLOB */
#ifdef USE_OPENSSL
tlsio_openssl_deinit();

Просмотреть файл

@ -2,8 +2,10 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
if(UNIX)
include(CMakeFindDependencyMacro)
find_dependency(CURL)
if(${use_http})
include(CMakeFindDependencyMacro)
find_dependency(CURL)
endif()
endif()
include("${CMAKE_CURRENT_LIST_DIR}/azure_c_shared_utilityTargets.cmake")