# Copyright 2022 John Maddock
# Copyright 2024 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

# bring in the rules for testing
require-b2 5.0.1 ;
import-search /boost/config/checks ;
import config : requires ;
import modules ;
import testing ;
import path ;
import pch ;
import type ;

# b2 registers the standard C++ suffixes (cpp cxx cc) but not cppm, so teach it
# that the .cppm module interface unit is a C++ source.
type.register-suffixes cppm : CPP ;

project
    : requirements
      <toolset>msvc:<warnings>all
      <toolset>msvc:<asynch-exceptions>on
      <toolset>msvc:<cxxstd>latest

      <toolset>gcc:<cxxflags>-fmodules-ts
      <toolset>gcc:<cxxstd>23

      <toolset>clang:<cxxstd>23
    ;

obj int128 : int128.cppm : <define>BOOST_INT128_EXPORT_TESTING <toolset>msvc:<cxxflags>-interface ;

run quick_test.cpp int128 : : : <dependency>int128 ;
run ../test/test_bit.cpp int128 : : : <dependency>int128 ;
run ../test/test_byte_conversions.cpp int128 : : : <dependency>int128 ;
run ../test/test_div.cpp int128 : : : <dependency>int128 ;
run ../test/test_from_chars_bases.cpp int128 : : : <dependency>int128 ;
run ../test/test_gcd_lcm.cpp int128 : : : <dependency>int128 ;
run ../test/test_hash.cpp int128 : : : <dependency>int128 ;
run ../test/test_ipow.cpp int128 : : : <dependency>int128 ;
run ../test/test_isqrt.cpp int128 : : : <dependency>int128 ;
run ../test/test_limits_i128.cpp int128 : : : <dependency>int128 ;
run ../test/test_limits_u128.cpp int128 : : : <dependency>int128 ;
run ../test/test_literals.cpp int128 : : : <dependency>int128 ;
run ../test/test_midpoint.cpp int128 : : : <dependency>int128 ;
run ../test/test_powm.cpp int128 : : : <dependency>int128 ;
