• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3#
4# Distributed under the Boost Software License, Version 1.0. (See accompanying
5# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6#
7# Official repository: https://github.com/boostorg/beast
8#
9
10import ac ;
11import os ;
12import path ;
13import feature ;
14import boost ;
15import modules ;
16import testing ;
17import ../config/checks/config : requires ;
18
19boost.use-project ;
20
21lib socket ; # SOLARIS, QNXNTO
22lib nsl ; # SOLARIS
23lib ws2_32 ; # NT
24lib mswsock ; # NT
25lib ipv6 ; # HPUX
26lib network ; # HAIKU
27
28lib ssl ;
29lib crypto ;
30lib crypt32 ;
31
32# Microsoft Windows section. Refer to FAQ "Windows and OpenSSL"
33if [ os.name ] = NT
34{
35  local OPENSSL_ROOT_DEFAULT = "C:/OpenSSL" ;
36  local OPENSSL_ROOT_ENV = [ os.environ OPENSSL_ROOT ] ;
37  local OPENSSL_ROOT = "" ;
38  if $(OPENSSL_ROOT_ENV)
39    {
40       OPENSSL_ROOT = $(OPENSSL_ROOT_ENV) ;
41    }
42  else
43    {
44      OPENSSL_ROOT = $(OPENSSL_ROOT_DEFAULT) ;
45    }
46  project
47    : requirements
48      <include>$(OPENSSL_ROOT)/include
49      <variant>debug:<library-path>$(OPENSSL_ROOT)/lib
50      <target-os>windows<variant>debug:<library-path>$(OPENSSL_ROOT)/debug/lib
51      <variant>release:<library-path>$(OPENSSL_ROOT)/lib
52    ;
53
54  if [ path.exists $(OPENSSL_ROOT)/lib/libssl.lib ]
55    {
56      echo "OpenSSL > 1.1.0. Including libssl" ;
57      lib ssl : : <target-os>windows <name>libssl ;
58    }
59  if [ path.exists $(OPENSSL_ROOT)/lib/libcrypto.lib ]
60    {
61      echo "OpenSSL > 1.1.0. Including libcrypto" ;
62      lib crypto : : <target-os>windows <name>libcrypto ;
63    }
64  if [ path.exists $(OPENSSL_ROOT)/lib/ssleay32.lib ]
65    {
66      echo "OpenSSL < 1.1.0. Including ssleay32" ;
67      lib ssl : : <target-os>windows <name>ssleay32 ;
68    }
69  if [ path.exists $(OPENSSL_ROOT)/lib/libeay32.lib ]
70    {
71      echo "OpenSSL < 1.1.0. Including libeay32" ;
72      lib crypto : : <target-os>windows <name>libeay32 ;
73    }
74}
75
76feature.feature boost.beast.allow-deprecated : on off : propagated composite ;
77feature.compose <boost.beast.allow-deprecated>on : <define>BOOST_BEAST_ALLOW_DEPRECATED ;
78
79feature.feature boost.beast.separate-compilation : on off : propagated composite ;
80feature.compose <boost.beast.separate-compilation>on : <define>BOOST_BEAST_SEPARATE_COMPILATION ;
81
82variant beast_coverage
83  : debug
84  : <cxxflags>"-msse4.2 --coverage"
85    <linkflags>"--coverage"
86  ;
87
88variant beast_valgrind
89  : release
90  : <valgrind>on # Boost.Context uses this property
91  ;
92
93variant beast_ubasan
94  : release
95  : <cxxflags>"-msse4.2 -funsigned-char -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined -fsanitize-blacklist=libs/beast/tools/blacklist.supp"
96    <linkflags>"-fsanitize=address,undefined"
97    <define>BOOST_USE_ASAN=1
98  ;
99
100path-constant TEST_MAIN : include/boost/beast/_experimental/unit_test/main.cpp ;
101
102project /boost/beast ;
103
104local defines =
105    [ requires
106    cxx11_constexpr
107    cxx11_decltype
108    cxx11_hdr_tuple
109    cxx11_template_aliases
110    cxx11_variadic_templates
111    ]
112    <implicit-dependency>/boost//headers
113    <include>.
114    <define>BOOST_ALL_NO_LIB=1
115    <define>BOOST_ASIO_SEPARATE_COMPILATION
116    <define>BOOST_ASIO_NO_DEPRECATED=1
117    <define>BOOST_ASIO_DISABLE_BOOST_ARRAY=1
118    <define>BOOST_ASIO_DISABLE_BOOST_BIND=1
119    <define>BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1
120    <define>BOOST_ASIO_DISABLE_BOOST_REGEX=1
121    <define>BOOST_COROUTINES_NO_DEPRECATION_WARNING=1
122    <toolset>msvc:<cxxflags>"/bigobj"
123    <toolset>msvc-14.1:<cxxflags>"/permissive-"
124    <toolset>msvc-14.2:<cxxflags>"/permissive-"
125    <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS=1
126    <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS=1
127    <toolset>msvc:<define>_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
128    <toolset>msvc:<define>_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING
129    <toolset>msvc,<variant>release:<cxxflags>"/Ob2 /Oi /Ot"
130    <target-os>linux:<define>_XOPEN_SOURCE=600
131    <target-os>linux:<define>_GNU_SOURCE=1
132    <target-os>solaris:<define>_XOPEN_SOURCE=500
133    <target-os>solaris:<define>__EXTENSIONS__
134    <target-os>solaris:<library>socket
135    <target-os>solaris:<library>nsl
136    <target-os>windows:<define>_WIN32_WINNT=0x0601
137    <target-os>windows,<toolset>gcc:<library>ws2_32
138    <target-os>windows,<toolset>gcc:<library>mswsock
139    <target-os>windows,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
140    <target-os>hpux,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
141    <target-os>hpux:<library>ipv6
142    <target-os>qnxnto:<library>socket
143    <target-os>haiku:<library>network
144    ;
145
146lib lib-asio
147    : test/lib_asio.cpp
148    : requirements
149        <link>static
150        $(defines)
151    : usage-requirements
152        $(defines)
153    ;
154
155lib lib-asio-ssl
156    : test/lib_asio_ssl.cpp
157    : requirements
158        <link>static
159        $(defines)
160        [ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ]
161        [ ac.check-library /boost/beast//crypto : <library>/boost/beast//crypto/<link>shared : <build>no ]
162    : usage-requirements
163        $(defines)
164    ;
165
166lib lib-beast
167    : test/lib_beast.cpp
168    : requirements
169    <link>static
170    $(defines)
171    : usage-requirements
172    $(defines)
173    ;
174