lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')

config.substitutions.append(('%{flags}',
  f'--target={config.target_triple} -Wno-multi-gpu -flto -march=native'))
config.substitutions.append(('%{compile_flags}',
    '-nogpulib -fno-builtin-printf -I %{include-dir} '
    '-I %{target-include-dir} -I %{libcxx-dir}/test/support'
))
config.substitutions.append(('%{link_flags}',
   '-nostdlib++ -startfiles -stdlib '
   '-L %{lib-dir} -lc++ -lc++abi '
   '-Wl,--suppress-stack-size-warning '
))
config.substitutions.append(('%{exec}',
    '%{executor} --no-parallelism'
))

config.stdlib = 'llvm-libc++'

import os, site
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
import libcxx.test.params, libcxx.test.config
libcxx.test.config.configure(
    libcxx.test.params.DEFAULT_PARAMETERS,
    libcxx.test.features.DEFAULT_FEATURES,
    config,
    lit_config
)
