Skip to content

Commit 198b0ad

Browse files
committed
Finished adding websocket support for Windows desktop with v140 toolset. Still requires NuGet packages that aren't avaliable in the gallery yet.
1 parent 144db5c commit 198b0ad

File tree

13 files changed

+75
-67
lines changed

13 files changed

+75
-67
lines changed

Release/include/cpprest/ws_client.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#ifndef _CASA_WS_CLIENT_H
2626
#define _CASA_WS_CLIENT_H
2727

28-
// Include on everything except VS2015 and Windows Desktop ARM, unless explicitly excluded.
29-
#if !defined(_MSC_VER) || ((_MSC_VER < 1900) && (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
28+
// Include on everything except Windows Desktop ARM, unless explicitly excluded.
29+
#if !defined(_MSC_VER) || (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3030

3131
#include <memory>
3232
#include <limits>

Release/include/cpprest/ws_msg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
****/
2323
#pragma once
2424

25-
// Include on everything except VS2015 and Windows Desktop ARM, unless explicitly excluded.
26-
#if !defined(_MSC_VER) || ((_MSC_VER < 1900) && (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
25+
// Include on everything except Windows Desktop ARM, unless explicitly excluded.
26+
#if !defined(_MSC_VER) || (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
2727

2828
#include <memory>
2929
#include <limits>

Release/src/build/vs14.wod/casablanca140.wod.vcxproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\Build\Release.Product.Settings" />
2222
<ImportGroup Label="PropertySheets">
2323
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
24-
<Import Project="..\..\..\..\packages\boost.1.57.0.0\build\native\boost.targets" Condition="Exists('..\..\..\..\packages\boost.1.57.0.0\build\native\boost.targets')" />
25-
<Import Project="..\..\..\..\packages\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets" Condition="Exists('..\..\..\..\packages\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets')" />
2624
</ImportGroup>
2725
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
2826
<DebugFileSuffix>d</DebugFileSuffix>
@@ -49,11 +47,4 @@
4947
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
5048
<Import Project="..\win32.vcxitems" Label="Shared" Condition="Exists('..\win32.vcxitems')" />
5149
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
52-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
53-
<PropertyGroup>
54-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
55-
</PropertyGroup>
56-
<Error Condition="!Exists('..\..\..\..\packages\boost.1.57.0.0\build\native\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\boost.1.57.0.0\build\native\boost.targets'))" />
57-
<Error Condition="!Exists('..\..\..\..\packages\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets'))" />
58-
</Target>
5950
</Project>

Release/src/build/vs14/casablanca140.vcxproj

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,49 @@
1818
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
2020
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\Build\Release.Product.Settings" />
21+
<PropertyGroup>
22+
<Linkage-zlib>static</Linkage-zlib>
23+
<Linkage-openssl>static</Linkage-openssl>
24+
</PropertyGroup>
2125
<ImportGroup Label="PropertySheets">
2226
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
2327
<Import Project="$(PackagesRoot)\boost.1.57.0.0\build\native\boost.targets" Condition="Exists('$(PackagesRoot)\boost.1.57.0.0\build\native\boost.targets')" />
2428
<Import Project="$(PackagesRoot)\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets" Condition="Exists('$(PackagesRoot)\boost_system-vc140.1.57.0-vc140ctp60\build\native\boost_system-vc140.targets')" />
2529
<Import Project="$(PackagesRoot)\zlib.v140.win32.msvcp.static.md.1.2.8-vc140ctp6\build\native\zlib.v140.win32.msvcp.static.md.targets" Condition="Exists('$(PackagesRoot)\zlib.v140.win32.msvcp.static.md.1.2.8-vc140ctp6\build\native\zlib.v140.win32.msvcp.static.md.targets')" />
2630
<Import Project="$(PackagesRoot)\openssl.v140.win32.msvcp.static.md.1.0.1-vc140ctp6\build\native\openssl.v140.win32.msvcp.static.md.targets" Condition="Exists('$(PackagesRoot)\openssl.v140.win32.msvcp.static.md.1.0.1-vc140ctp6\build\native\openssl.v140.win32.msvcp.static.md.targets')" />
31+
<Import Project="$(PackagesRoot)\boost_date_time-vc140.1.57.0-vc140ctp60\build\native\boost_date_time-vc140.targets" Condition="Exists('$(PackagesRoot)\boost_date_time-vc140.1.57.0-vc140ctp60\build\native\boost_date_time-vc140.targets')" />
32+
<Import Project="$(PackagesRoot)\boost_regex-vc140.1.57.0-vc140ctp60\build\native\boost_regex-vc140.targets" Condition="Exists('$(PackagesRoot)\boost_regex-vc140.1.57.0-vc140ctp60\build\native\boost_regex-vc140.targets')" />
2733
</ImportGroup>
2834
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
2935
<DebugFileSuffix>d</DebugFileSuffix>
3036
</PropertyGroup>
3137
<PropertyGroup>
3238
<TargetName>$(CppRestBaseFileName)140$(DebugFileSuffix)_$(CppRestSDKVersionFileSuffix)</TargetName>
33-
<NuGetPackageImportStamp>8e6ffa7c</NuGetPackageImportStamp>
39+
<NuGetPackageImportStamp>eec97f90</NuGetPackageImportStamp>
3440
</PropertyGroup>
41+
<ItemGroup>
42+
<None Include="packages.config">
43+
<SubType>Designer</SubType>
44+
</None>
45+
</ItemGroup>
3546
<ItemDefinitionGroup>
3647
<ClCompile>
3748
<PreprocessorDefinitions>_ASYNCRT_EXPORT;_PPLX_EXPORT;WIN32;_MBCS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
3849
<AdditionalIncludeDirectories>$(CasablancaIncludeDir);$(CasablancaSrcDir)\pch;$(WebsocketppIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
3950
<PrecompiledHeader>Use</PrecompiledHeader>
4051
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
4152
<AdditionalOptions>-Zm300 /bigobj %(AdditionalOptions)</AdditionalOptions>
53+
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebugDLL</RuntimeLibrary>
54+
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreadedDLL</RuntimeLibrary>
4255
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
56+
57+
<!-- Disable warning about decorated name length exceeded, name was truncated. This is due to Boost.Asio and Websocket++ templates. -->
58+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
59+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
60+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
61+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
62+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
63+
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
4364
</ClCompile>
4465
<Link>
4566
<AdditionalDependencies>Winhttp.lib;httpapi.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="boost" version="1.57.0" targetFramework="native" developmentDependency="true" userInstalled="true" />
4-
<package id="boost_system-vc140" version="boost_system-vc140.1.57.0-vc140ctp60" targetFramework="native" developmentDependency="true" userInstalled="true" />
4+
<package id="boost_date_time-vc140" version="1.57.0-vc140ctp60" targetFramework="Native" developmentDependency="true" userInstalled="true" />
5+
<package id="boost_regex-vc140" version="1.57.0-vc140ctp60" targetFramework="Native" developmentDependency="true" userInstalled="true" />
6+
<package id="boost_system-vc140" version="1.57.0-vc140ctp60" targetFramework="native" developmentDependency="true" userInstalled="true" />
57
<package id="openssl.v140.win32.msvcp.static.md" version="1.0.1-vc140ctp6" targetFramework="native" developmentDependency="true" userInstalled="true" />
68
<package id="zlib.v140.win32.msvcp.static.md" version="1.2.8-vc140ctp6" targetFramework="native" developmentDependency="true" userInstalled="true" />
79
</packages>

Release/src/websockets/client/ws_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
****/
2323
#include "stdafx.h"
2424

25-
// Include on everything except VS2015 and Windows Desktop ARM, unless explicitly excluded.
26-
#if !defined(_MSC_VER) || ((_MSC_VER < 1900) && (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
25+
// Include on everything except Windows Desktop ARM, unless explicitly excluded.
26+
#if !defined(_WIN32) || (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
2727

2828
namespace web
2929
{

Release/src/websockets/client/ws_client_wspp.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "stdafx.h"
2727
#include "cpprest/details/x509_cert_utilities.h"
2828

29-
// Include on everything except VS2015 and Windows Desktop ARM, unless explicitly excluded.
30-
#if !defined(_MSC_VER) || ((_MSC_VER < 1900) && (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
29+
// Include on everything except Windows Desktop ARM, unless explicitly excluded.
30+
#if !defined(_WIN32) || (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3131

3232
// Force websocketpp to use C++ std::error_code instead of Boost.
3333
#define _WEBSOCKETPP_CPP11_SYSTEM_ERROR_
@@ -54,20 +54,28 @@
5454
#endif
5555
#pragma GCC diagnostic pop
5656
#else /* __GNUC__ */
57+
#if defined(_WIN32)
5758
#pragma warning( push )
5859
#pragma warning( disable : 4100 4127 4512 4996 4701 4267 )
59-
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
60+
#if _MSC_VER >= 1800
6061
#define _WEBSOCKETPP_CPP11_STL_
61-
#define _WEBSOCKETPP_INITIALIZER_LISTS_
62-
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
6362
#define _WEBSOCKETPP_CONSTEXPR_TOKEN_
63+
#if _MSC_VER < 1900
64+
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
65+
#endif
6466
#else
6567
#define _WEBSOCKETPP_NULLPTR_TOKEN_ 0
6668
#endif
69+
#endif
70+
6771
#include <websocketpp/config/asio_client.hpp>
6872
#include <websocketpp/config/asio_no_tls_client.hpp>
6973
#include <websocketpp/client.hpp>
74+
75+
#if defined(_WIN32)
7076
#pragma warning( pop )
77+
#endif
78+
7179
#endif /* __GNUC__ */
7280

7381
using websocketpp::lib::placeholders::_1;

Release/src/websockets/client/ws_msg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
****/
2727
#include "stdafx.h"
2828

29-
// Include on everything except VS2015 and Windows Desktop ARM, unless explicitly excluded.
30-
#if !defined(_MSC_VER) || ((_MSC_VER < 1900) && (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
29+
// Include on everything except Windows Desktop ARM, unless explicitly excluded.
30+
#if !defined(_WIN32) || (defined(__cplusplus_winrt) || !defined(__cplusplus_winrt) && !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3131

3232
using namespace concurrency;
3333
using namespace concurrency::streams::details;

Release/tests/functional/websockets/client/dirs.proj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
<ItemGroup Condition="'$(OsVersion)|$(DevToolsVersion)'=='6.3|120'">
2121
<ProjectFile Include="VS12.winrt\websocketsclient120_test.winrt.vcxproj" />
2222
</ItemGroup>
23-
23+
-->
2424
<ItemGroup Condition="'$(DevToolsVersion)'=='140'">
25-
<ProjectFile Include="vs14\websocketsclient140_test.vcxproj" />
26-
<ProjectFile Include="vs14.android\websocketsclient140_test.android.vcxproj" Condition="'$(Platform)'!='x64'" />
25+
<ProjectFile Include="vs14\websocketsclient140_test.vcxproj" />
26+
<!-- <ProjectFile Include="vs14.android\websocketsclient140_test.android.vcxproj" Condition="'$(Platform)'!='x64'" /> -->
2727
</ItemGroup>
28-
-->
28+
2929

3030
<Import Project="$(TargetsPath)\Common.Build.Traversal.targets" />
3131

Release/tests/functional/websockets/client/vs14/websocketsclient140_test.vcxproj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@
6565
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
6666
</Link>
6767
</ItemDefinitionGroup>
68-
<!-- If testing against a VS installation, need to include the libs. -->
69-
<ItemDefinitionGroup Condition="'$(BuildAgainstVSInstallation)'!=''">
70-
<Link>
71-
<AdditionalLibraryDirectories>$(CasablancaVSLibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
72-
</Link>
73-
<Link>
74-
<GenerateDebugInformation>true</GenerateDebugInformation>
75-
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
76-
</Link>
77-
</ItemDefinitionGroup>
7868
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
7969
<ClCompile>
8070
<Optimization>Disabled</Optimization>

0 commit comments

Comments
 (0)