Remove the need for OpenSSL in examples that don't use it

close #1524

It is now possible to compile examples without OpenSSL. Examples that
do require OpenSSL will be omitted.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2019-03-18 22:42:31 +01:00
committed by Vinnie Falco
parent 0c3ca62590
commit 05f3f8a5ce
21 changed files with 61 additions and 36 deletions

View File

@ -1,3 +1,9 @@
Version 234:
* Don't link to OpenSSL needlessly (bjam)
--------------------------------------------------------------------------------
Version 233:
* Check __ANDROID__ instead

26
Jamfile
View File

@ -76,6 +76,29 @@ lib static_beast
<toolset>msvc:<define>_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING
<target-os>windows:<define>_WIN32_WINNT=0x0601
<link>static
: usage-requirements
<define>BOOST_BEAST_SPLIT_COMPILATION
<define>BOOST_ASIO_SEPARATE_COMPILATION
<define>BOOST_ASIO_NO_DEPRECATED=1
<define>BOOST_ASIO_DISABLE_BOOST_ARRAY=1
<define>BOOST_ASIO_DISABLE_BOOST_BIND=1
<define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1
<define>BOOST_ASIO_DISABLE_BOOST_REGEX=1
<define>BOOST_COROUTINES_NO_DEPRECATION_WARNING=1
<toolset>msvc-14.1:<cxxflags>"/permissive-"
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS=1
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS=1
<toolset>msvc:<define>_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
<toolset>msvc:<define>_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING
<target-os>windows:<define>_WIN32_WINNT=0x0601
;
lib static_ssl_asio
: test/lib_ssl.cpp
: requirements
<link>static
<library>static_beast
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ]
[ ac.check-library /boost/beast//crypto : <library>/boost/beast//crypto/<link>shared : <build>no ]
;
project /boost/beast
@ -84,14 +107,11 @@ project /boost/beast
<include>./test/extras/include
<library>/boost/coroutine//boost_coroutine
<library>/boost/filesystem//boost_filesystem
#<library>static_asio
<library>static_beast
<implicit-dependency>/boost//headers
<threading>multi
<debug-symbols>on
<runtime-link>shared
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
<define>BOOST_ALL_NO_LIB=1
<define>BOOST_BEAST_SPLIT_COMPILATION
<define>BOOST_ASIO_SEPARATE_COMPILATION

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe advanced-server-flex :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-client-async-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-client-coro-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-client-sync-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-server-async-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-server-coro-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-server-flex :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-server-stackless-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe http-server-sync-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-client-async-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-client-coro-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-client-sync-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-server-async-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-server-coro-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-server-stackless-ssl :

View File

@ -11,8 +11,7 @@ import ac ;
project
: requirements
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl : <build>no ]
<library>/boost/beast//crypto
[ ac.check-library /boost/beast//static_ssl_asio : <library>/boost/beast//static_ssl_asio : <build>no ]
;
exe websocket-server-sync-ssl :

View File

@ -24,6 +24,7 @@ project /boost/beast/test
<define>BOOST_BEAST_ALLOW_DEPRECATED
<define>BOOST_BEAST_TESTS
<define>BOOST_ASIO_SEPARATE_COMPILATION
<library>/boost/beast//static_ssl_asio
;
path-constant ZLIB_SOURCES :

View File

@ -12,7 +12,6 @@
// BOOST_ASIO_SEPARATE_COMPILATION for asio
#include <boost/asio/impl/src.hpp>
#include <boost/asio/ssl/impl/src.hpp>
// BOOST_BEAST_SPLIT_COMPILATION for beast
#include <boost/beast/src.hpp>

15
test/lib_ssl.cpp Normal file
View File

@ -0,0 +1,15 @@
//
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//
// This file is used to build a static library with
// asio and beast definitions, to reduce compilation time.
// BOOST_ASIO_SEPARATE_COMPILATION for asio::ssl
#include <boost/asio/ssl/impl/src.hpp>