azure-sdk-for-cpp/cmake-modules/DefineTransportAdapter.cmake
Victor Vazquez 74020a397a
make Curl default option to build on Win as a temp workaround (#753)
* make Curl default option to build on Win as a temp workaround

* Temporarily disable setting WinHTTP as a transport adapter since it
hasn't been implemented yet, to unblock building master.

Co-authored-by: Ahson Khan <ahkha@microsoft.com>
2020-10-14 12:15:56 -07:00

24 lines
1.1 KiB
CMake

## Copyright (c) Microsoft Corporation. All rights reserved.
## SPDX-License-Identifier: MIT
############# TRANSPORT ADAPTER BUILD #####################
# Default: If no option is explicitly added, curl will be used for POSIX and WIN HTTP for Windows #
# Windows: Both CURL and WIN_HTTP can be built to be used. #
# POSIX: Only CURL is acceptable. If WIN_HTTP is set, generate step will fail for user #
# Defines `BUILD_TRANSPORT_WINHTTP_ADAPTER` and `BUILD_CURL_HTTP_TRANSPORT_ADAPTER` for source code
if (WIN32 OR MINGW OR MSYS OR CYGWIN)
add_compile_definitions(BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
SET(BUILD_TRANSPORT_CURL ON)
elseif(UNIX)
if(BUILD_TRANSPORT_WINHTTP)
message(FATAL_ERROR "Win HTTP transport adapter is not supported for Unix platforms")
endif()
# regardless if CURL transport is set or not, it is always added for UNIX as default
add_compile_definitions(BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
SET(BUILD_TRANSPORT_CURL ON)
else()
message(FATAL_ERROR "Unsupported platform")
endif ()