# # Copyright (c) 2019-2025 Ruben Perez Hidalgo (rubenperez038 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) # require-b2 5.0.1 ; import-search /boost/config/checks ; import os ; import path ; import feature ; import ac ; import indirect ; import config : requires ; # Support header-only builds feature.feature boost.mysql.separate-compilation : on off : propagated composite ; # Support builds with BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT feature.feature boost.mysql.use-ts-executor : off on : propagated composite ; # Support builds forcing !BOOST_ASIO_HAS_LOCAL_SOCKETS feature.feature boost.mysql.disable-local-sockets : off on : propagated composite ; # Support valgrind feature.feature boost.mysql.valgrind : off on : propagated composite ; feature.compose on : BOOST_USE_VALGRIND ; # Configure openssl if it hasn't been done yet using openssl ; # Provide a way to fail the build if OpenSSL is not found - used by CIs rule do_fail_impl ( a * ) { exit "OpenSSL could not be found. Don't build target fail_if_no_openssl to skip this check" ; } local do_fail = [ indirect.make do_fail_impl ] ; alias fail_if_no_openssl : requirements [ ac.check-library /openssl//ssl : : @$(do_fail) ] [ ac.check-library /openssl//crypto : : @$(do_fail) ] ; explicit fail_if_no_openssl ; # Requirements to use across targets local requirements = BOOST_ALL_NO_LIB=1 BOOST_ASIO_NO_DEPRECATED=1 BOOST_ASIO_DISABLE_BOOST_ARRAY=1 BOOST_ASIO_DISABLE_BOOST_BIND=1 BOOST_ASIO_DISABLE_BOOST_DATE_TIME=1 BOOST_ASIO_DISABLE_BOOST_REGEX=1 BOOST_ASIO_DISABLE_BOOST_COROUTINE=1 BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS=1 BOOST_ALLOW_DEPRECATED_HEADERS=1 # Disable warning C4702: unreachable code, produced by Boost.Asio buffer.hpp # Disable warning C4459: declaration xxx hides global declaration, produced by Boost.Asio win_iocp_file_service.ipp # Remove /wd4100 when PFR fixes warnings msvc:"/bigobj /wd4702 /wd4100 /wd4459 /permissive-" msvc:_SCL_SECURE_NO_WARNINGS=1 msvc:_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING msvc:_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING msvc:_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING msvc:_CRT_SECURE_NO_WARNINGS # Required by Asio # gcc-13+ doesn't understand view types and issues array bound warnings that don't make sense. # -Wno-implicit-fallthrough is required by Asio SSL components gcc:"-Wno-dangling-reference -Wno-array-bounds -Wno-implicit-fallthrough" # gcc-13+ complains about TSAN not supporting std::atomic_thread_fence, # used by Asio old net-ts type-erased executors. gcc,norecover:-Wno-tsan # gcc-11 emits spurious warnings for valid vector::insert ops gcc-11:-Wno-stringop-overflow # gcc-15 emits spurious warnings about uninitialized variables in coroutines gcc-15:-Wno-maybe-uninitialized # TODO: remove when PFR unused warnings are fixed # https://github.com/boostorg/pfr/pull/187 gcc:-Wno-unused-parameter clang:-Wno-unused-parameter linux:_XOPEN_SOURCE=600 linux:_GNU_SOURCE=1 windows:_WIN32_WINNT=0x0601 on:BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT # Disable assertions when doing coverage, as they distort coverage data on:BOOST_DISABLE_ASSERTS on:BOOST_ASIO_DISABLE_LOCAL_SOCKETS ; alias boost_mysql : $(boost_dependencies)/off /openssl//ssl/shared /openssl//crypto/shared : requirements [ requires cxx11_defaulted_moves cxx11_final cxx11_hdr_array cxx11_hdr_chrono cxx11_hdr_tuple cxx11_hdr_type_traits cxx11_numeric_limits cxx11_override cxx11_smart_ptr cxx11_trailing_result_types cxx11_template_aliases cxx11_variadic_templates ] [ ac.check-library /openssl//ssl : /openssl//ssl/shared : no ] [ ac.check-library /openssl//crypto : /openssl//crypto/shared : no ] $(requirements) : usage-requirements $(requirements) ; lib boost_mysql_compiled : common/src/boost_asio.cpp boost_mysql : requirements on:common/src/boost_mysql.cpp on:BOOST_MYSQL_SEPARATE_COMPILATION BOOST_ASIO_SEPARATE_COMPILATION static : usage-requirements on:BOOST_MYSQL_SEPARATE_COMPILATION BOOST_ASIO_SEPARATE_COMPILATION ; alias common_test_sources : common/src/entry_point.cpp common/src/utils.cpp ; # Boost.Context causes failures with warnings-as-errors # under libc++, because it builds objects that raise a -stdlib=libc++ unused warning alias boost_context_lib : /boost/context//boost_context/off ; # Beast and JSON depend on Container, which causes trouble with on alias boost_beast_lib : /boost/beast//boost_beast/off ; alias boost_json_lib : /boost/json//boost_json/off ; alias boost_mysql_test : boost_mysql_compiled # Unit test library generates some internal warnings we're not interested in /boost/test//boost_unit_test_framework/off : requirements static common/include : usage-requirements common/include ; # Mark a test as runnable using Valgrind. Some tests use # an intermediate Python runner, so just setting testing.launcher globally is incorrect alias launch_with_valgrind : usage-requirements on:"valgrind --leak-check=full --error-limit=yes --error-exitcode=1 --gen-suppressions=all" ; build-project unit ;