Closed lordgamez closed 3 years ago
I think this is a bug of core SDK. We should have a default transport layer if not explicitly specified.
@vhvb1989 Matching the transport to the OS by default would make on-boarding easier. On Windows they get WinHttp and everywhere else they would get CURL.
the symbol BUILD_CURL_HTTP_TRANSPORT_ADAPTER
is added by out CMake module DefineTransportAdapter
.
It makes sure to set a default transport adapter depending on the OS when no transport was explicitly mentioned at generate time.
@RickWinter , before fixing this, can you define if we will support using ExternalProject_Add
from CMake?
My understanding is that @antkmsft is finalizing the vcpkg support to be our main release vehicle. vcpkg and CMake ExternalProject_Add
behaves differently. Vcpkg would get any dependency chain (for blobs, it would take storage-common, azure core, libcurl, json, xml, etc..). While using CMake, we would still need to document how to make it work (how to get dependencies, and what dependencies).
At any case, I would personally prefer to recommend using fetchContent
vs ExternalProject_Add
when using CMake as a package manager. See: https://www.scivision.dev/cmake-fetchcontent-vs-external-project/
When using fetchContent, the top CMake list works well to define all the default symbols we need.
@antkmsft can you please validate that this scenario is fixed with your change in #1346
I am sure this is fixed on latest preview release. @RickWinter can we close and ask @lordgamez to re-open if he continue to see this issue?
I am sure this is fixed on latest preview release. @RickWinter can we close and ask @lordgamez to re-open if he continue to see this issue?
I am okay with this approach, thank you!
Describe the bug When adding azure-sdk-for-cpp as an external library to a client application and including blobs.hpp compilation fails. Including blobs.hpp transitively includes policy.hpp as well which uses CurlTransport included from curl.hpp. CurlTransport is not defined as the client library using Azure SDK does not contain the BUILD_CURL_HTTP_TRANSPORT_ADAPTER definition which is required for the CurlTransport compilation.
Workaround: add
add_definitions("-DBUILD_CURL_HTTP_TRANSPORT_ADAPTER")
to the cmake files of the client library. Preliminary analysis: Seems to be present since commit cd2a8a3Exception or Stack Trace
To Reproduce Steps to reproduce the behavior:
azure/storage/blobs.hpp
in your project and compile.Code Snippet
Expected behavior It should be possible to add Azure SDK as an external project and include its headers without the need to define BUILD_CURL_HTTP_TRANSPORT_ADAPTER in the client library.
Screenshots N/A
Setup (please complete the following information):
Additional context Add any other context about the problem here.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report