import libs = libenkits%lib{enkits}

# One executable per source file (each example is a single translation unit).
#
for t: cxx{*}
{
  n = $name($t)
  ./: exe{example-$n}: hxx{Timer} $t $libs testscript
}

# The C examples are pure C but link the C++ library. Use the C++ link rule
# (via a rule hint) so they are linked with the C++ compiler driver, which
# pulls in the C++ runtime. Without this a static link fails with undefined
# references to the C++ runtime (operator new/delete, std::thread, etc).
#
for t: c{*}
{
  n = $name($t)
  ./: exe{example-$n}
  [rule_hint=cxx] exe{example-$n}: $t $libs testscript
}

# Long-running benchmarks are built but not run as part of the default
# test suite (many warm-up and timed iterations).
#
for n: ParallelSum TaskThroughput TaskOverhead ParallelSum_c
  exe{example-$n}: test = false
