#  Boost.OpenMethod Library Configuration Checks Jamfile
#
#  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

# The probe consulted by ../test/Jamfile. It sits here, and not under test/,
# because a b2 subproject inherits its parent's requirements: a check target
# declared in the test project would carry the very conditional it is being
# consulted for, and asking for it would ask for itself.
#
# The project has an id, and the test Jamfile refers to the probe by it: the
# requirement is inherited by the test subprojects too, and a relative
# reference would be resolved from each of their directories.

import testing ;

project /boost/openmethod/config ;

obj has_reflection : has_reflection.cpp : <cxxflags>-freflection ;
explicit has_reflection ;

# The other probe: BMI2's pext, which only policies/minimal_cover_hash.hpp
# needs. Probing beats naming an architecture - a <architecture>x86 conditional
# does not match every toolset spelling, and a compiler that rejects -mbmi2
# outright would take the directory down with it.
#
# `run`, not `obj`: the compiler accepts -mbmi2 - and emits `pext` - whenever
# the toolchain supports the extension, whether or not the machine running the
# build implements it in hardware. A handful of CI runners pair a BMI2-capable
# compiler with pre-Haswell (or feature-masked) silicon, where the instruction
# traps with SIGILL; a compile-only check cannot see that; see has_bmi2.cpp.
run has_bmi2.cpp : : : <cxxflags>-mbmi2 <include>../include ;
explicit has_bmi2 ;
