mirror of
https://github.com/boostorg/beast.git
synced 2025-06-25 03:51:36 +02:00
cmake: Use static libs to speed up builds
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
Version 237:
|
||||
|
||||
* cmake: Use static libs to speed up builds
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Version 236:
|
||||
|
||||
* root_certificates.hpp: brought in the server certificate
|
||||
|
117
CMakeLists.txt
117
CMakeLists.txt
@ -10,6 +10,33 @@
|
||||
cmake_minimum_required (VERSION 3.5.1)
|
||||
cmake_policy (SET CMP0074 NEW)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
function (DoGroupSources curdir rootdir folder)
|
||||
file (GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*)
|
||||
foreach (child ${children})
|
||||
if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
DoGroupSources (${curdir}/${child} ${rootdir} ${folder})
|
||||
elseif (${child} STREQUAL "CMakeLists.txt")
|
||||
source_group("" FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
else()
|
||||
string (REGEX REPLACE ^${rootdir} ${folder} groupname ${curdir})
|
||||
string (REPLACE "/" "\\" groupname ${groupname})
|
||||
source_group (${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function (GroupSources curdir folder)
|
||||
DoGroupSources (${curdir} ${curdir} ${folder})
|
||||
endfunction()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Beast
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
project (Beast VERSION 236)
|
||||
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
@ -69,10 +96,28 @@ endif()
|
||||
# IDE sees the wrong file due to boost/ symlinks.
|
||||
include_directories (include)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# OpenSSL
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
|
||||
find_program(HOMEBREW brew)
|
||||
if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
|
||||
execute_process(COMMAND brew --prefix openssl
|
||||
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Boost
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
get_filename_component (BOOST_ROOT ../../ ABSOLUTE)
|
||||
|
||||
@ -94,44 +139,6 @@ if (MINGW)
|
||||
link_libraries(ws2_32 mswsock)
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# OpenSSL
|
||||
#
|
||||
|
||||
if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
|
||||
find_program(HOMEBREW brew)
|
||||
if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
|
||||
execute_process(COMMAND brew --prefix openssl
|
||||
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL)
|
||||
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
function (DoGroupSources curdir rootdir folder)
|
||||
file (GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${curdir} ${PROJECT_SOURCE_DIR}/${curdir}/*)
|
||||
foreach (child ${children})
|
||||
if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
DoGroupSources (${curdir}/${child} ${rootdir} ${folder})
|
||||
elseif (${child} STREQUAL "CMakeLists.txt")
|
||||
source_group("" FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
else()
|
||||
string (REGEX REPLACE ^${rootdir} ${folder} groupname ${curdir})
|
||||
string (REPLACE "/" "\\" groupname ${groupname})
|
||||
source_group (${groupname} FILES ${PROJECT_SOURCE_DIR}/${curdir}/${child})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function (GroupSources curdir folder)
|
||||
DoGroupSources (${curdir} ${curdir} ${folder})
|
||||
endfunction()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if ("${VARIANT}" STREQUAL "coverage")
|
||||
@ -159,6 +166,40 @@ elseif ("${VARIANT}" STREQUAL "release")
|
||||
|
||||
endif()
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Static Libraries
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION=1)
|
||||
add_definitions (-DBOOST_BEAST_SPLIT_COMPILATION=1)
|
||||
|
||||
GroupSources (test "/")
|
||||
|
||||
add_library (
|
||||
lib-asio STATIC
|
||||
test/lib_asio.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET lib-asio PROPERTY FOLDER "static-libs")
|
||||
|
||||
add_library (
|
||||
lib-asio-ssl STATIC
|
||||
test/lib_asio_ssl.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET lib-asio-ssl PROPERTY FOLDER "static-libs")
|
||||
|
||||
add_library (
|
||||
lib-beast STATIC
|
||||
test/lib_beast.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET lib-beast PROPERTY FOLDER "static-libs")
|
||||
|
||||
target_link_libraries(lib-asio lib-beast)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
# Tests and examples
|
||||
|
4
Jamfile
4
Jamfile
@ -97,7 +97,7 @@ local defines =
|
||||
;
|
||||
|
||||
lib static_beast
|
||||
: test/lib_beast.cpp
|
||||
: test/_lib_beast.cpp
|
||||
: requirements
|
||||
$(defines)
|
||||
<include>./test/extras/include
|
||||
@ -107,7 +107,7 @@ lib static_beast
|
||||
;
|
||||
|
||||
lib static_ssl_asio
|
||||
: test/lib_ssl.cpp
|
||||
: test/_lib_ssl.cpp
|
||||
: requirements
|
||||
<library>/boost/beast//static_beast/<link>static
|
||||
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ]
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (advanced-server-flex
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (advanced-server
|
||||
advanced_server.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(advanced-server
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET advanced-server PROPERTY FOLDER "example-advanced-server")
|
||||
|
@ -16,4 +16,8 @@ add_executable (echo-op
|
||||
echo_op.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(echo-op
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET echo-op PROPERTY FOLDER "example")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-client-async-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-client-async
|
||||
http_client_async.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-client-async
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-client-async PROPERTY FOLDER "example-http-client")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-client-coro-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-client-coro
|
||||
http_client_coro.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-client-coro
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-client-coro PROPERTY FOLDER "example-http-client")
|
||||
|
@ -18,5 +18,9 @@ add_executable (http-crawl
|
||||
http_crawl.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-crawl
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-crawl PROPERTY FOLDER "example-http-client")
|
||||
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-client-sync-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-client-sync
|
||||
http_client_sync.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-client-sync
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-client-sync PROPERTY FOLDER "example-http-client")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-server-async-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,9 @@ add_executable (http-server-async
|
||||
http_server_async.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-async
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-async PROPERTY FOLDER "example-http-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-server-coro-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-server-coro
|
||||
http_server_coro.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-coro
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-coro PROPERTY FOLDER "example-http-server")
|
||||
|
@ -19,4 +19,8 @@ add_executable (http-server-fast
|
||||
http_server_fast.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-fast
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-fast PROPERTY FOLDER "example-http-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-server-flex
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-server-small
|
||||
http_server_small.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-small
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-small PROPERTY FOLDER "example-http-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-server-stackless-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (http-server-stackless
|
||||
http_server_stackless.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-stackless
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-stackless PROPERTY FOLDER "example-http-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (http-server-sync-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,9 @@ add_executable (http-server-sync
|
||||
http_server_sync.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(http-server-sync
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET http-server-sync PROPERTY FOLDER "example-http-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-client-async-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-client-async
|
||||
websocket_client_async.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-client-async
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-client-async PROPERTY FOLDER "example-websocket-client")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-client-coro-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-client-coro
|
||||
websocket_client_coro.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-client-coro
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-client-coro PROPERTY FOLDER "example-websocket-client")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-client-sync-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-client-sync
|
||||
websocket_client_sync.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-client-sync
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-client-sync PROPERTY FOLDER "example-websocket-client")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-server-async-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-server-async
|
||||
websocket_server_async.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-async
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-server-async PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -8,7 +8,7 @@
|
||||
#
|
||||
|
||||
GroupSources(include/boost/beast beast)
|
||||
GroupSources(example/cppcon2018 "/")
|
||||
GroupSources(example/websocket/server/chat-multi "/")
|
||||
|
||||
file (GLOB APP_FILES
|
||||
beast.hpp
|
||||
@ -34,4 +34,8 @@ add_executable (websocket-chat-multi
|
||||
${BOOST_BEAST_FILES}
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-chat-multi
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-chat-multi PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-server-coro-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-server-coro
|
||||
websocket_server_coro.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-coro
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-server-coro PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-server-fast
|
||||
websocket_server_fast.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-fast
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-server-fast PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-server-stackless-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-server-stackless
|
||||
websocket_server_stackless.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-stackless
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-server-stackless PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
|
||||
|
||||
target_link_libraries (websocket-server-sync-ssl
|
||||
OpenSSL::SSL OpenSSL::Crypto
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
)
|
||||
|
||||
endif()
|
||||
|
@ -16,4 +16,8 @@ add_executable (websocket-server-sync
|
||||
websocket_server_sync.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(websocket-server-sync
|
||||
lib-asio
|
||||
lib-beast)
|
||||
|
||||
set_property(TARGET websocket-server-sync PROPERTY FOLDER "example-websocket-server")
|
||||
|
@ -13,6 +13,7 @@ include_directories (./extras/include)
|
||||
file (GLOB_RECURSE EXTRAS_FILES
|
||||
${PROJECT_SOURCE_DIR}/test/extras/include/*.hpp
|
||||
${PROJECT_SOURCE_DIR}/test/extras/include/*.ipp
|
||||
${PROJECT_SOURCE_DIR}/test/lib_ssl.cpp
|
||||
)
|
||||
|
||||
if (OPENSSL_FOUND)
|
||||
@ -44,6 +45,15 @@ set (ZLIB_SOURCES
|
||||
|
||||
set (TEST_MAIN ${PROJECT_SOURCE_DIR}/test/lib_beast.cpp)
|
||||
|
||||
GroupSources (. "/")
|
||||
|
||||
add_library (
|
||||
lib-test STATIC
|
||||
${PROJECT_SOURCE_DIR}/include/boost/beast/_experimental/unit_test/main.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET lib-test PROPERTY FOLDER "static-libs")
|
||||
|
||||
add_definitions (-DBOOST_BEAST_INCLUDE_TEST_MAIN)
|
||||
add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION)
|
||||
add_definitions (-DBOOST_BEAST_SPLIT_COMPILATION)
|
||||
|
22
test/_lib_beast.cpp
Normal file
22
test/_lib_beast.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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
|
||||
#include <boost/asio/impl/src.hpp>
|
||||
|
||||
// BOOST_BEAST_SPLIT_COMPILATION for beast
|
||||
#include <boost/beast/src.hpp>
|
||||
//#include <boost/beast/ssl/impl/src.hpp>
|
||||
|
||||
#ifdef BOOST_BEAST_INCLUDE_TEST_MAIN
|
||||
#include <boost/beast/_experimental/unit_test/main.cpp>
|
||||
#endif
|
@ -8,8 +8,9 @@
|
||||
#
|
||||
|
||||
add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED)
|
||||
add_definitions (-DBOOST_BEAST_TESTS)
|
||||
|
||||
# For buffers_cat
|
||||
add_definitions (-DBOOST_BEAST_TESTS)
|
||||
|
||||
add_subdirectory (_experimental)
|
||||
add_subdirectory (core)
|
||||
@ -21,13 +22,11 @@ add_subdirectory (zlib)
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/beast "/")
|
||||
|
||||
add_executable (tests-beast
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
core.cpp
|
||||
http.cpp
|
||||
@ -37,4 +36,10 @@ add_executable (tests-beast
|
||||
zlib.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test)
|
||||
|
||||
set_property(TARGET tests-beast PROPERTY FOLDER "tests")
|
||||
|
@ -8,17 +8,20 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/beast/_experimental "/")
|
||||
|
||||
add_executable (tests-beast-_experimental
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
error.cpp
|
||||
icy_stream.cpp
|
||||
stream.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-_experimental
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-_experimental PROPERTY FOLDER "tests")
|
||||
|
@ -8,13 +8,10 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/beast/core "/")
|
||||
|
||||
add_executable (tests-beast-core
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
test_buffer.hpp
|
||||
file_test.hpp
|
||||
@ -69,4 +66,11 @@ add_executable (tests-beast-core
|
||||
tcp_stream.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-core
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-core PROPERTY FOLDER "tests")
|
||||
|
@ -14,7 +14,6 @@ GroupSources (test/beast/http "/")
|
||||
add_executable (tests-beast-http
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
message_fuzz.hpp
|
||||
test_parser.hpp
|
||||
@ -43,4 +42,11 @@ add_executable (tests-beast-http
|
||||
write.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-http
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-http PROPERTY FOLDER "tests")
|
||||
|
@ -12,9 +12,15 @@ GroupSources (test/beast/ssl "/")
|
||||
|
||||
add_executable (tests-beast-ssl
|
||||
${BOOST_BEAST_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
ssl_stream.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-ssl
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-ssl PROPERTY FOLDER "tests")
|
||||
|
@ -14,7 +14,6 @@ GroupSources (test/beast/websocket "/")
|
||||
add_executable (tests-beast-websocket
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
_detail_decorator.cpp
|
||||
_detail_prng.cpp
|
||||
@ -43,4 +42,11 @@ add_executable (tests-beast-websocket
|
||||
write.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-websocket
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-websocket PROPERTY FOLDER "tests")
|
||||
|
@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/extern/zlib-1.2.11 zlib)
|
||||
GroupSources (test/beast/zlib "/")
|
||||
|
||||
@ -18,9 +17,7 @@ endif()
|
||||
|
||||
add_executable (tests-beast-zlib
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${ZLIB_SOURCES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
error.cpp
|
||||
deflate_stream.cpp
|
||||
@ -28,4 +25,10 @@ add_executable (tests-beast-zlib
|
||||
zlib.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-beast-zlib
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-zlib PROPERTY FOLDER "tests")
|
||||
|
@ -8,15 +8,18 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/bench/buffers "/")
|
||||
|
||||
add_executable (bench-buffers
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
bench_buffers.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(bench-buffers
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET bench-buffers PROPERTY FOLDER "tests-bench")
|
||||
|
@ -8,14 +8,11 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/beast/http "/")
|
||||
GroupSources (test/bench/parser "/")
|
||||
|
||||
add_executable (bench-parser
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp
|
||||
nodejs_parser.hpp
|
||||
@ -23,4 +20,10 @@ add_executable (bench-parser
|
||||
bench_parser.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(bench-parser
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET bench-parser PROPERTY FOLDER "tests-bench")
|
||||
|
@ -8,15 +8,18 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/bench/utf8_checker "/")
|
||||
|
||||
add_executable (bench-utf8-checker
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
bench_utf8_checker.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(bench-utf8-checker
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET bench-utf8-checker PROPERTY FOLDER "tests-bench")
|
||||
|
@ -8,20 +8,17 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (example/common common)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/bench/wsload "/")
|
||||
|
||||
remove_definitions (-DBOOST_BEAST_INCLUDE_TEST_MAIN)
|
||||
remove_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION)
|
||||
remove_definitions (-DBOOST_BEAST_SPLIT_COMPILATION)
|
||||
|
||||
add_executable (bench-wsload
|
||||
${BOOST_BEAST_FILES}
|
||||
${COMMON_FILES}
|
||||
${EXTRAS_FILES}
|
||||
Jamfile
|
||||
wsload.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(bench-wsload
|
||||
lib-asio
|
||||
lib-beast
|
||||
)
|
||||
|
||||
set_property(TARGET bench-wsload PROPERTY FOLDER "tests-bench")
|
||||
|
@ -8,7 +8,6 @@
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/extern/zlib-1.2.11 zlib)
|
||||
GroupSources (test/bench/zlib "/")
|
||||
|
||||
@ -18,12 +17,15 @@ endif()
|
||||
|
||||
add_executable (bench-zlib
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${ZLIB_SOURCES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
deflate_stream.cpp
|
||||
inflate_stream.cpp
|
||||
)
|
||||
target_link_libraries(bench-zlib
|
||||
lib-asio
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET bench-zlib PROPERTY FOLDER "tests-bench")
|
||||
|
@ -9,13 +9,10 @@
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (example example)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/doc "/")
|
||||
|
||||
add_executable (tests-doc
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
snippets.hpp
|
||||
snippets.ipp
|
||||
@ -39,4 +36,11 @@ add_executable (tests-doc
|
||||
exemplars.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-doc
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-doc PROPERTY FOLDER "tests")
|
||||
|
@ -16,10 +16,16 @@ add_executable (tests-example-common
|
||||
${BOOST_BEAST_FILES}
|
||||
${COMMON_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
root_certificates.cpp
|
||||
server_certificate.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(tests-example-common
|
||||
lib-asio
|
||||
lib-asio-ssl
|
||||
lib-beast
|
||||
lib-test
|
||||
)
|
||||
|
||||
set_property(TARGET tests-example-common PROPERTY FOLDER "tests")
|
12
test/lib_asio.cpp
Normal file
12
test/lib_asio.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/asio/impl/src.hpp>
|
12
test/lib_asio_ssl.cpp
Normal file
12
test/lib_asio_ssl.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <boost/asio/ssl/impl/src.hpp>
|
@ -7,16 +7,6 @@
|
||||
// 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.
|
||||
// This file is used to build a static library
|
||||
|
||||
// BOOST_ASIO_SEPARATE_COMPILATION for asio
|
||||
#include <boost/asio/impl/src.hpp>
|
||||
|
||||
// BOOST_BEAST_SPLIT_COMPILATION for beast
|
||||
#include <boost/beast/src.hpp>
|
||||
//#include <boost/beast/ssl/impl/src.hpp>
|
||||
|
||||
#ifdef BOOST_BEAST_INCLUDE_TEST_MAIN
|
||||
#include <boost/beast/_experimental/unit_test/main.cpp>
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user