import libs  = libppqsort%lib{ppqsort}

# liba{gtest_main} links the static gtest, so link gmock statically too.
# Otherwise gmock brings in the shared gtest as well, which fails to link
# on Windows with multiple definitions.
#
import libs += gmock%liba{gmock}
import libs += gtest%liba{gtest_main}

exe{libppqsort-tests}: {hxx ixx txx cxx}{**} $libs
exe{libppqsort-tests}: test = true

# The ppqsort.cpp object exceeds the 32767 section limit of the regular
# PE/COFF object format in non-optimized builds. Use the big object format
# with MinGW GCC (the MSVC equivalent is /bigobj).
#
if ($cxx.target.class == 'windows' && $cxx.id == 'gcc')
  obje{ppqsort}: cxx.coptions += -Wa,-mbig-obj

# Benign narrowing in the libppqsort headers (thread counts and block
# lengths of at most 1024) and the tests (sizes of at most 100000 and
# ranges checked to fit the element type).
#
if ($cxx.id == 'msvc')
  cxx.coptions += /wd4244 /wd4267

out_pfx = [dir_path] $out_root/source/
src_pfx = [dir_path] $src_root/source/

cxx.poptions =+ "-I$out_pfx" "-I$src_pfx"
