import std; import Crafter.Build; namespace fs = std::filesystem; using namespace Crafter; extern "C" Configuration CrafterBuildProject(std::span) { Configuration cfg; cfg.path = "./"; cfg.name = "cuda-test"; cfg.outputName = "cuda-test"; cfg.target = "x86_64-pc-linux-gnu"; cfg.type = ConfigurationType::Executable; std::array ifaces = {}; std::array impls = { "main" }; cfg.GetInterfacesAndImplementations(ifaces, impls); cfg.cuda.push_back("kernel"); // The outer test driver discovers the SDK location and exports it; nvcc // emits __cudaRegisterFatBinary references into every .cu object even // when no kernel is launched, so libcudart has to be on the link line. if (const char* libDir = std::getenv("CRAFTER_CUDA_LIBDIR")) { cfg.linkFlags.push_back(std::format("-L{}", libDir)); cfg.linkFlags.push_back("-lcudart"); } return cfg; }