Skip to content

Commit

Permalink
Build the HTTP client on Windows and Linux (microsoft#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
airaolagoitia authored Jun 18, 2020
1 parent e188724 commit 995fc75
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 14 deletions.
17 changes: 7 additions & 10 deletions Release/include/cpprest/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,13 @@ typedef void* native_handle;

#include "cpprest/oauth2.h"

#if !defined(_WIN32) && !defined(__cplusplus_winrt) || defined(CPPREST_FORCE_HTTP_CLIENT_ASIO)
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"
#endif
#include "boost/asio/ssl.hpp"
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
namespace boost {
namespace asio {
namespace ssl {
class context;
} // namespace ssl
} // namespace asio
} // namespace boost

/// The web namespace contains functionality common to multiple protocols like HTTP and WebSockets.
namespace web
Expand Down
4 changes: 4 additions & 0 deletions Release/src/http/common/http_compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#if defined(CPPREST_HTTP_COMPRESSION)
#include <zlib.h>
// zconf.h may define compress
#ifdef compress
#undef compress
#endif
#if !defined(CPPREST_EXCLUDE_BROTLI)
#define CPPREST_BROTLI_COMPRESSION
#endif // CPPREST_EXCLUDE_BROTLI
Expand Down
10 changes: 6 additions & 4 deletions Release/src/pch/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@
#include "cpprest/details/web_utilities.h"

// http
//#include "cpprest/details/http_helpers.h"
//#include "cpprest/http_client.h"
//#include "cpprest/http_headers.h"
//#include "cpprest/http_msg.h"
#if defined(RTC_WINDOWS_FAMILY) || defined(RTC_LINUX_FAMILY)
#include "cpprest/details/http_helpers.h"
#include "cpprest/http_client.h"
#include "cpprest/http_headers.h"
#include "cpprest/http_msg.h"
#endif

// oauth
#if !defined(_WIN32) || _WIN32_WINNT >= _WIN32_WINNT_VISTA
Expand Down
38 changes: 38 additions & 0 deletions cpprest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ project "cpprest"
defines {
"_NO_PPLXIMP", -- prevent building a dynamic library
"_NO_ASYNCRTIMP",
"CPPREST_EXCLUDE_BROTLI",
"CPPREST_EXCLUDE_WEBSOCKETS",
}

files {
Expand All @@ -37,6 +39,22 @@ project "cpprest"
"Release/src/pch",
"Release/include",
"../boost",
"../zlib",
}

local t_httpfiles = {
"Release/src/http/client/http_client.cpp",
"Release/src/http/client/http_client_msg.cpp",
"Release/src/http/common/http_compression.cpp",
"Release/src/http/common/http_helpers.cpp",
"Release/src/http/common/http_msg.cpp",
"Release/src/http/oauth/oauth1.cpp",
"Release/src/http/oauth/oauth2.cpp",
"Release/src/json/json.cpp",
"Release/src/json/json_parsing.cpp",
"Release/src/json/json_serialization.cpp",
"Release/src/utilities/base64.cpp",
"Release/src/utilities/web_utilities.cpp",
}

-- -------------------------------------------------------------
Expand All @@ -61,6 +79,8 @@ project "cpprest"
}

files {
t_httpfiles,
"Release/src/http/client/http_client_winhttp.cpp",
"Release/src/pplx/pplxwin.cpp",
}

Expand Down Expand Up @@ -133,7 +153,15 @@ project "cpprest"
configuration { "linux" }

files {
t_httpfiles,
"Release/src/http/client/http_client_asio.cpp",
"Release/src/http/client/x509_cert_utilities.cpp",
"Release/src/pplx/pplxlinux.cpp",
"Release/src/pplx/threadpool.cpp",
}

includedirs {
"../openssl/include",
}

-- -------------------------------------------------------------
Expand Down Expand Up @@ -313,7 +341,15 @@ project "cpprest"
configuration { "android*" }

files {
t_httpfiles,
"Release/src/http/client/http_client_asio.cpp",
"Release/src/http/client/x509_cert_utilities.cpp",
"Release/src/pplx/pplxlinux.cpp",
"Release/src/pplx/threadpool.cpp",
}

includedirs {
"../openssl/include",
}

-- -------------------------------------------------------------
Expand Down Expand Up @@ -433,6 +469,8 @@ project "cpprest"
}

files {
t_httpfiles,
"Release/src/http/client/http_client_winrt.cpp",
"Release/src/pplx/pplxwin.cpp",
}

Expand Down

0 comments on commit 995fc75

Please sign in to comment.