# Boost.Atomic Library Jamfile # # Copyright Helge Bahmann 2011. # Copyright Andrey Semashev 2018, 2020-2025. # # 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) import-search /boost/config/checks ; import common ; import config : requires ; import path ; import project ; import feature ; import configure ; import atomic-arch-config ; lib synchronization ; explicit synchronization ; local cxx_requirements = [ requires cxx11_constexpr cxx11_noexcept cxx11_nullptr cxx11_decltype cxx11_decltype_n3276 cxx11_template_aliases cxx11_static_assert cxx11_rvalue_references cxx11_scoped_enums cxx11_defaulted_functions cxx11_deleted_functions cxx11_hdr_ratio cxx11_hdr_chrono ] [ check-target-builds ../config//has_cxx11_nontrivial_union "has unions with non-trivial members" : : no ] [ check-target-builds ../config//has_sufficient_cxx11_type_traits "has sufficient for Boost.Atomic" : : no ] ; project : common-requirements ../include $(boost_dependencies) : requirements /boost/align//boost_align /boost/preprocessor//boost_preprocessor ../src multi shared:BOOST_ATOMIC_DYN_LINK=1 static:BOOST_ATOMIC_STATIC_LINK=1 BOOST_ATOMIC_SOURCE windows:BOOST_USE_WINDOWS_H gcc,windows:"-lkernel32" : usage-requirements shared:BOOST_ATOMIC_DYN_LINK=1 static:BOOST_ATOMIC_STATIC_LINK=1 BOOST_ATOMIC_NO_LIB=1 : source-location ../src ; BOOST_ATOMIC_SOURCES_SSE2 = find_address_sse2 ; BOOST_ATOMIC_SOURCES_SSE41 = find_address_sse41 ; for local src in $(BOOST_ATOMIC_SOURCES_SSE2) { obj $(src) : ## sources ## $(src).cpp : ## requirements ## @atomic-arch-config.sse2-flags shared:BOOST_ATOMIC_DYN_LINK=1 static:BOOST_ATOMIC_STATIC_LINK=1 BOOST_ATOMIC_SOURCE ; explicit $(src) ; } for local src in $(BOOST_ATOMIC_SOURCES_SSE41) { obj $(src) : ## sources ## $(src).cpp : ## requirements ## @atomic-arch-config.sse41-flags shared:BOOST_ATOMIC_DYN_LINK=1 static:BOOST_ATOMIC_STATIC_LINK=1 BOOST_ATOMIC_SOURCE ; explicit $(src) ; } rule check-pthread-cond-clockwait ( properties * ) { local result ; local has_pthread_cond_clockwait = [ configure.builds ../config//has_pthread_cond_clockwait : $(properties) : "has pthread_cond_clockwait" ] ; if $(has_pthread_cond_clockwait) { result = BOOST_ATOMIC_HAS_PTHREAD_COND_CLOCKWAIT ; } return $(result) ; } rule select-arch-specific-sources ( properties * ) { local result ; if x86 in [ atomic-arch-config.deduce-architecture $(properties) ] { if [ configure.builds ../config//has_sse2 : $(properties) : "compiler supports SSE2" ] { result += $(BOOST_ATOMIC_SOURCES_SSE2) ; result += BOOST_ATOMIC_USE_SSE2 ; } if [ configure.builds ../config//has_sse41 : $(properties) : "compiler supports SSE4.1" ] { result += $(BOOST_ATOMIC_SOURCES_SSE41) ; result += BOOST_ATOMIC_USE_SSE41 ; } } # ECHO "Arch sources: " $(result) ; return $(result) ; } lib boost_atomic : ## sources ## lock_pool.cpp : ## requirements ## ../src @check-pthread-cond-clockwait @select-arch-specific-sources windows:synchronization # MinGW-w64 defines _WIN32_WINNT to _WIN32_WINNT_WS03 by default, which disables WaitOnAddress API that is required by Boost.Atomic. # Define the macro ourselves to the Windows version required by Boost.Atomic. # https://github.com/boostorg/atomic/issues/73 gcc,windows:_WIN32_WINNT=0x0A00 $(cxx_requirements) : usage-requirements windows:synchronization gcc,windows:_WIN32_WINNT=0x0A00 $(cxx_requirements) ;