import libs = liboneapi-openmp%libs{openmp}

# __kmpc_fork_call (emitted for #pragma omp parallel) is only in libiomp5md,
# not in the stubs lib. The flag below ensures the compiler emits it.
if ($cxx.class == 'msvc')
  cxx.coptions += /openmp:llvm
else
  cxx.coptions += -fopenmp

for t : cxx{* -openmp-omptarget}
{
  n = $name($t)
  ./: exe{test-$n}: $t $libs
}

import omptarget = liboneapi-openmp%libs{openmp-omptarget}
exe{test-openmp-omptarget}: cxx{openmp-omptarget} $omptarget

# Requires intel.oneapi.{lin,win}.dpcpp-cpp-common.runtime (libsycl/sycl.dll,
# libur_loader) which is not yet packaged.
#
./: exe{test-openmp-omptarget}: include = false
