//SPDX-License-Identifier: LGPL-3.0-only //SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® module; #include "Crafter.Build-Api.h" export module Crafter.Build:Platform; import std; namespace fs = std::filesystem; namespace Crafter { struct Configuration; struct CommandResult { int exitCode = 0; std::string output; bool crashed = false; bool timedOut = false; int signal = 0; }; std::string BuildStdPcm(const Configuration& config, fs::path stdPcm); fs::path GetCacheDir(); std::string RunCommand(const std::string_view command); CommandResult RunCommandChecked(std::string_view command); export CRAFTER_API CommandResult RunCommandWithTimeout(std::string_view command, std::chrono::seconds timeout); std::string GetBaseCommand(const Configuration& config); export CRAFTER_API Configuration LoadProject(const fs::path& projectFile, std::span args); // Resolves the directory holding distributed runtime assets (Crafter.Build // module sources, wasi-runtime/, etc). Honors CRAFTER_BUILD_HOME; otherwise // derives /share/crafter-build from the running executable's path. export CRAFTER_API fs::path GetCrafterBuildHome(); }