cmake: Use static libs to speed up builds

This commit is contained in:
Vinnie Falco
2019-03-23 15:57:24 -07:00
parent b01d692ad7
commit b38901887b
60 changed files with 369 additions and 91 deletions

View File

@ -1,3 +1,9 @@
Version 237:
* cmake: Use static libs to speed up builds
--------------------------------------------------------------------------------
Version 236: Version 236:
* root_certificates.hpp: brought in the server certificate * root_certificates.hpp: brought in the server certificate

View File

@ -10,6 +10,33 @@
cmake_minimum_required (VERSION 3.5.1) cmake_minimum_required (VERSION 3.5.1)
cmake_policy (SET CMP0074 NEW) 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) project (Beast VERSION 236)
set_property (GLOBAL PROPERTY USE_FOLDERS ON) set_property (GLOBAL PROPERTY USE_FOLDERS ON)
@ -69,10 +96,28 @@ endif()
# IDE sees the wrong file due to boost/ symlinks. # IDE sees the wrong file due to boost/ symlinks.
include_directories (include) 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 # Boost
# #
#-------------------------------------------------------------------------------
get_filename_component (BOOST_ROOT ../../ ABSOLUTE) get_filename_component (BOOST_ROOT ../../ ABSOLUTE)
@ -94,44 +139,6 @@ if (MINGW)
link_libraries(ws2_32 mswsock) link_libraries(ws2_32 mswsock)
endif() 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") if ("${VARIANT}" STREQUAL "coverage")
@ -159,6 +166,40 @@ elseif ("${VARIANT}" STREQUAL "release")
endif() 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 # Tests and examples

View File

@ -97,7 +97,7 @@ local defines =
; ;
lib static_beast lib static_beast
: test/lib_beast.cpp : test/_lib_beast.cpp
: requirements : requirements
$(defines) $(defines)
<include>./test/extras/include <include>./test/extras/include
@ -107,7 +107,7 @@ lib static_beast
; ;
lib static_ssl_asio lib static_ssl_asio
: test/lib_ssl.cpp : test/_lib_ssl.cpp
: requirements : requirements
<library>/boost/beast//static_beast/<link>static <library>/boost/beast//static_beast/<link>static
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ] [ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ]

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (advanced-server-flex target_link_libraries (advanced-server-flex
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (advanced-server
advanced_server.cpp advanced_server.cpp
) )
target_link_libraries(advanced-server
lib-asio
lib-beast)
set_property(TARGET advanced-server PROPERTY FOLDER "example-advanced-server") set_property(TARGET advanced-server PROPERTY FOLDER "example-advanced-server")

View File

@ -16,4 +16,8 @@ add_executable (echo-op
echo_op.cpp echo_op.cpp
) )
target_link_libraries(echo-op
lib-asio
lib-beast)
set_property(TARGET echo-op PROPERTY FOLDER "example") set_property(TARGET echo-op PROPERTY FOLDER "example")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-client-async-ssl target_link_libraries (http-client-async-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-client-async
http_client_async.cpp 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") set_property(TARGET http-client-async PROPERTY FOLDER "example-http-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-client-coro-ssl target_link_libraries (http-client-coro-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-client-coro
http_client_coro.cpp 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") set_property(TARGET http-client-coro PROPERTY FOLDER "example-http-client")

View File

@ -18,5 +18,9 @@ add_executable (http-crawl
http_crawl.cpp http_crawl.cpp
) )
target_link_libraries(http-crawl
lib-asio
lib-beast)
set_property(TARGET http-crawl PROPERTY FOLDER "example-http-client") set_property(TARGET http-crawl PROPERTY FOLDER "example-http-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-client-sync-ssl target_link_libraries (http-client-sync-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-client-sync
http_client_sync.cpp 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") set_property(TARGET http-client-sync PROPERTY FOLDER "example-http-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-server-async-ssl target_link_libraries (http-server-async-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,9 @@ add_executable (http-server-async
http_server_async.cpp 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") set_property(TARGET http-server-async PROPERTY FOLDER "example-http-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-server-coro-ssl target_link_libraries (http-server-coro-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-server-coro
http_server_coro.cpp 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") set_property(TARGET http-server-coro PROPERTY FOLDER "example-http-server")

View File

@ -19,4 +19,8 @@ add_executable (http-server-fast
http_server_fast.cpp 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") set_property(TARGET http-server-fast PROPERTY FOLDER "example-http-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-server-flex target_link_libraries (http-server-flex
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-server-small
http_server_small.cpp 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") set_property(TARGET http-server-small PROPERTY FOLDER "example-http-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-server-stackless-ssl target_link_libraries (http-server-stackless-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (http-server-stackless
http_server_stackless.cpp 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") set_property(TARGET http-server-stackless PROPERTY FOLDER "example-http-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (http-server-sync-ssl target_link_libraries (http-server-sync-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,9 @@ add_executable (http-server-sync
http_server_sync.cpp 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") set_property(TARGET http-server-sync PROPERTY FOLDER "example-http-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-client-async-ssl target_link_libraries (websocket-client-async-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-client-async
websocket_client_async.cpp 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") set_property(TARGET websocket-client-async PROPERTY FOLDER "example-websocket-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-client-coro-ssl target_link_libraries (websocket-client-coro-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-client-coro
websocket_client_coro.cpp 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") set_property(TARGET websocket-client-coro PROPERTY FOLDER "example-websocket-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-client-sync-ssl target_link_libraries (websocket-client-sync-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-client-sync
websocket_client_sync.cpp 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") set_property(TARGET websocket-client-sync PROPERTY FOLDER "example-websocket-client")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-server-async-ssl target_link_libraries (websocket-server-async-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-server-async
websocket_server_async.cpp 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") set_property(TARGET websocket-server-async PROPERTY FOLDER "example-websocket-server")

View File

@ -8,7 +8,7 @@
# #
GroupSources(include/boost/beast beast) GroupSources(include/boost/beast beast)
GroupSources(example/cppcon2018 "/") GroupSources(example/websocket/server/chat-multi "/")
file (GLOB APP_FILES file (GLOB APP_FILES
beast.hpp beast.hpp
@ -34,4 +34,8 @@ add_executable (websocket-chat-multi
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
) )
target_link_libraries(websocket-chat-multi
lib-asio
lib-beast)
set_property(TARGET websocket-chat-multi PROPERTY FOLDER "example-websocket-server") set_property(TARGET websocket-chat-multi PROPERTY FOLDER "example-websocket-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-server-coro-ssl target_link_libraries (websocket-server-coro-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-server-coro
websocket_server_coro.cpp 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") set_property(TARGET websocket-server-coro PROPERTY FOLDER "example-websocket-server")

View File

@ -16,4 +16,8 @@ add_executable (websocket-server-fast
websocket_server_fast.cpp 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") set_property(TARGET websocket-server-fast PROPERTY FOLDER "example-websocket-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-server-stackless-ssl target_link_libraries (websocket-server-stackless-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-server-stackless
websocket_server_stackless.cpp 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") set_property(TARGET websocket-server-stackless PROPERTY FOLDER "example-websocket-server")

View File

@ -23,6 +23,9 @@ if (OPENSSL_FOUND)
target_link_libraries (websocket-server-sync-ssl target_link_libraries (websocket-server-sync-ssl
OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto
lib-asio
lib-asio-ssl
lib-beast
) )
endif() endif()

View File

@ -16,4 +16,8 @@ add_executable (websocket-server-sync
websocket_server_sync.cpp 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") set_property(TARGET websocket-server-sync PROPERTY FOLDER "example-websocket-server")

View File

@ -13,6 +13,7 @@ include_directories (./extras/include)
file (GLOB_RECURSE EXTRAS_FILES file (GLOB_RECURSE EXTRAS_FILES
${PROJECT_SOURCE_DIR}/test/extras/include/*.hpp ${PROJECT_SOURCE_DIR}/test/extras/include/*.hpp
${PROJECT_SOURCE_DIR}/test/extras/include/*.ipp ${PROJECT_SOURCE_DIR}/test/extras/include/*.ipp
${PROJECT_SOURCE_DIR}/test/lib_ssl.cpp
) )
if (OPENSSL_FOUND) if (OPENSSL_FOUND)
@ -44,6 +45,15 @@ set (ZLIB_SOURCES
set (TEST_MAIN ${PROJECT_SOURCE_DIR}/test/lib_beast.cpp) 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_BEAST_INCLUDE_TEST_MAIN)
add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION) add_definitions (-DBOOST_ASIO_SEPARATE_COMPILATION)
add_definitions (-DBOOST_BEAST_SPLIT_COMPILATION) add_definitions (-DBOOST_BEAST_SPLIT_COMPILATION)

22
test/_lib_beast.cpp Normal file
View 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

View File

@ -8,8 +8,9 @@
# #
add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED) add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED)
add_definitions (-DBOOST_BEAST_TESTS)
# For buffers_cat
add_definitions (-DBOOST_BEAST_TESTS)
add_subdirectory (_experimental) add_subdirectory (_experimental)
add_subdirectory (core) add_subdirectory (core)
@ -21,13 +22,11 @@ add_subdirectory (zlib)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/beast "/") GroupSources (test/beast "/")
add_executable (tests-beast add_executable (tests-beast
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES} ${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
core.cpp core.cpp
http.cpp http.cpp
@ -37,4 +36,10 @@ add_executable (tests-beast
zlib.cpp zlib.cpp
) )
target_link_libraries(tests-beast
lib-asio
lib-asio-ssl
lib-beast
lib-test)
set_property(TARGET tests-beast PROPERTY FOLDER "tests") set_property(TARGET tests-beast PROPERTY FOLDER "tests")

View File

@ -8,17 +8,20 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/beast/_experimental "/") GroupSources (test/beast/_experimental "/")
add_executable (tests-beast-_experimental add_executable (tests-beast-_experimental
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
error.cpp error.cpp
icy_stream.cpp icy_stream.cpp
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") set_property(TARGET tests-beast-_experimental PROPERTY FOLDER "tests")

View File

@ -8,13 +8,10 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/beast/core "/") GroupSources (test/beast/core "/")
add_executable (tests-beast-core add_executable (tests-beast-core
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
test_buffer.hpp test_buffer.hpp
file_test.hpp file_test.hpp
@ -69,4 +66,11 @@ add_executable (tests-beast-core
tcp_stream.cpp 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") set_property(TARGET tests-beast-core PROPERTY FOLDER "tests")

View File

@ -14,7 +14,6 @@ GroupSources (test/beast/http "/")
add_executable (tests-beast-http add_executable (tests-beast-http
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES} ${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
message_fuzz.hpp message_fuzz.hpp
test_parser.hpp test_parser.hpp
@ -43,4 +42,11 @@ add_executable (tests-beast-http
write.cpp 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") set_property(TARGET tests-beast-http PROPERTY FOLDER "tests")

View File

@ -12,9 +12,15 @@ GroupSources (test/beast/ssl "/")
add_executable (tests-beast-ssl add_executable (tests-beast-ssl
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${TEST_MAIN}
Jamfile Jamfile
ssl_stream.cpp 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") set_property(TARGET tests-beast-ssl PROPERTY FOLDER "tests")

View File

@ -14,7 +14,6 @@ GroupSources (test/beast/websocket "/")
add_executable (tests-beast-websocket add_executable (tests-beast-websocket
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES} ${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
_detail_decorator.cpp _detail_decorator.cpp
_detail_prng.cpp _detail_prng.cpp
@ -43,4 +42,11 @@ add_executable (tests-beast-websocket
write.cpp 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") set_property(TARGET tests-beast-websocket PROPERTY FOLDER "tests")

View File

@ -8,7 +8,6 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/extern/zlib-1.2.11 zlib) GroupSources (test/extern/zlib-1.2.11 zlib)
GroupSources (test/beast/zlib "/") GroupSources (test/beast/zlib "/")
@ -18,9 +17,7 @@ endif()
add_executable (tests-beast-zlib add_executable (tests-beast-zlib
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${ZLIB_SOURCES} ${ZLIB_SOURCES}
${TEST_MAIN}
Jamfile Jamfile
error.cpp error.cpp
deflate_stream.cpp deflate_stream.cpp
@ -28,4 +25,10 @@ add_executable (tests-beast-zlib
zlib.cpp zlib.cpp
) )
target_link_libraries(tests-beast-zlib
lib-asio
lib-beast
lib-test
)
set_property(TARGET tests-beast-zlib PROPERTY FOLDER "tests") set_property(TARGET tests-beast-zlib PROPERTY FOLDER "tests")

View File

@ -8,15 +8,18 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/bench/buffers "/") GroupSources (test/bench/buffers "/")
add_executable (bench-buffers add_executable (bench-buffers
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
bench_buffers.cpp bench_buffers.cpp
) )
target_link_libraries(bench-buffers
lib-asio
lib-beast
lib-test
)
set_property(TARGET bench-buffers PROPERTY FOLDER "tests-bench") set_property(TARGET bench-buffers PROPERTY FOLDER "tests-bench")

View File

@ -8,14 +8,11 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/beast/http "/") GroupSources (test/beast/http "/")
GroupSources (test/bench/parser "/") GroupSources (test/bench/parser "/")
add_executable (bench-parser add_executable (bench-parser
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp ${PROJECT_SOURCE_DIR}/test/beast/http/message_fuzz.hpp
nodejs_parser.hpp nodejs_parser.hpp
@ -23,4 +20,10 @@ add_executable (bench-parser
bench_parser.cpp bench_parser.cpp
) )
target_link_libraries(bench-parser
lib-asio
lib-beast
lib-test
)
set_property(TARGET bench-parser PROPERTY FOLDER "tests-bench") set_property(TARGET bench-parser PROPERTY FOLDER "tests-bench")

View File

@ -8,15 +8,18 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/bench/utf8_checker "/") GroupSources (test/bench/utf8_checker "/")
add_executable (bench-utf8-checker add_executable (bench-utf8-checker
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
bench_utf8_checker.cpp 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") set_property(TARGET bench-utf8-checker PROPERTY FOLDER "tests-bench")

View File

@ -8,20 +8,17 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (example/common common)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/bench/wsload "/") 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 add_executable (bench-wsload
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${COMMON_FILES}
${EXTRAS_FILES}
Jamfile Jamfile
wsload.cpp wsload.cpp
) )
target_link_libraries(bench-wsload
lib-asio
lib-beast
)
set_property(TARGET bench-wsload PROPERTY FOLDER "tests-bench") set_property(TARGET bench-wsload PROPERTY FOLDER "tests-bench")

View File

@ -8,7 +8,6 @@
# #
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/extern/zlib-1.2.11 zlib) GroupSources (test/extern/zlib-1.2.11 zlib)
GroupSources (test/bench/zlib "/") GroupSources (test/bench/zlib "/")
@ -18,12 +17,15 @@ endif()
add_executable (bench-zlib add_executable (bench-zlib
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${ZLIB_SOURCES} ${ZLIB_SOURCES}
${TEST_MAIN}
Jamfile Jamfile
deflate_stream.cpp deflate_stream.cpp
inflate_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") set_property(TARGET bench-zlib PROPERTY FOLDER "tests-bench")

View File

@ -9,13 +9,10 @@
GroupSources (include/boost/beast beast) GroupSources (include/boost/beast beast)
GroupSources (example example) GroupSources (example example)
GroupSources (test/extras/include/boost/beast extras)
GroupSources (test/doc "/") GroupSources (test/doc "/")
add_executable (tests-doc add_executable (tests-doc
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
snippets.hpp snippets.hpp
snippets.ipp snippets.ipp
@ -39,4 +36,11 @@ add_executable (tests-doc
exemplars.cpp exemplars.cpp
) )
target_link_libraries(tests-doc
lib-asio
lib-asio-ssl
lib-beast
lib-test
)
set_property(TARGET tests-doc PROPERTY FOLDER "tests") set_property(TARGET tests-doc PROPERTY FOLDER "tests")

View File

@ -16,10 +16,16 @@ add_executable (tests-example-common
${BOOST_BEAST_FILES} ${BOOST_BEAST_FILES}
${COMMON_FILES} ${COMMON_FILES}
${EXTRAS_FILES} ${EXTRAS_FILES}
${TEST_MAIN}
Jamfile Jamfile
root_certificates.cpp root_certificates.cpp
server_certificate.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") set_property(TARGET tests-example-common PROPERTY FOLDER "tests")

12
test/lib_asio.cpp Normal file
View 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
View 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>

View File

@ -7,16 +7,6 @@
// Official repository: https://github.com/boostorg/beast // Official repository: https://github.com/boostorg/beast
// //
// This file is used to build a static library with // This file is used to build a static library
// 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/src.hpp>
//#include <boost/beast/ssl/impl/src.hpp>
#ifdef BOOST_BEAST_INCLUDE_TEST_MAIN
#include <boost/beast/_experimental/unit_test/main.cpp>
#endif