File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,9 @@ cc_library(
270270 "WIN32_LEAN_AND_MEAN" ,
271271 "_WIN32_WINNT=0x0A00" ,
272272 ],
273- "//conditions:default" : [],
273+ "//conditions:default" : [
274+ "GOOGLE_CLOUD_CPP_HAVE_OPENSSL" ,
275+ ],
274276 }),
275277 visibility = ["//:__subpackages__" ],
276278 deps = [
Original file line number Diff line number Diff line change @@ -146,6 +146,11 @@ if (WIN32)
146146 target_link_libraries (google_cloud_cpp_rest_internal PUBLIC ws2_32 bcrypt
147147 crypt32)
148148else ()
149+ # We already require OpenSSL for non-Windows platforms.
150+ target_compile_definitions (
151+ google_cloud_cpp_rest_internal
152+ PUBLIC # Enable OpenSSL specific functionality.
153+ GOOGLE_CLOUD_CPP_HAVE_OPENSSL)
149154 target_link_libraries (google_cloud_cpp_rest_internal PUBLIC OpenSSL::SSL
150155 OpenSSL::Crypto)
151156endif ()
Original file line number Diff line number Diff line change 1717#include " google/cloud/internal/curl_options.h"
1818#include " google/cloud/internal/make_status.h"
1919#include " google/cloud/log.h"
20- #ifndef _WIN32
20+ #ifdef GOOGLE_CLOUD_CPP_HAVE_OPENSSL
2121#include < openssl/err.h>
2222#include < openssl/ssl.h>
2323#endif
@@ -30,7 +30,7 @@ namespace rest_internal {
3030GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3131namespace {
3232
33- #ifndef _WIN32
33+ #ifdef GOOGLE_CLOUD_CPP_HAVE_OPENSSL
3434struct BIOPtrCleanup {
3535 int operator ()(BIO* b) const { return BIO_free (b); }
3636};
@@ -49,7 +49,7 @@ using SSL_CTX = void;
4949#endif
5050
5151Status SetCurlCAInMemory (CurlHandleFactory const & factory, SSL_CTX* ssl_ctx) {
52- #if _WIN32
52+ #ifndef GOOGLE_CLOUD_CPP_HAVE_OPENSSL
5353 return internal::InternalError (
5454 " SSL callback function currently not supported in windows" ,
5555 GCP_ERROR_INFO ());
You can’t perform that action at this time.
0 commit comments