Crafter.Build/interfaces/Crafter.Build-Interface.cppm
Jorijn van der Graaf 8892154b28
Some checks failed
CI / build-test-release (push) Failing after 7m15s
linting
2026-07-23 01:24:42 +02:00

39 lines
1.6 KiB
C++

// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
module;
#include "Crafter.Build-Api.h"
export module Crafter.Build:Interface;
import std;
namespace fs = std::filesystem;
namespace Crafter {
export class Module;
export class ModulePartition {
public:
std::vector<Module*> moduleDependencies;
std::vector<ModulePartition*> partitionDependencies;
std::vector<std::pair<Module*, fs::path>> externalModuleDependencies;
std::atomic<bool> compiled;
bool needsRecompiling;
bool checked = false;
std::string name;
fs::path path;
CRAFTER_API ModulePartition(std::string&& name, fs::path&& path);
CRAFTER_API bool Check(const fs::path& pcmDir, fs::file_time_type sourceFloor = fs::file_time_type::min());
CRAFTER_API void Compile(const std::string_view clang, const fs::path& pcmDir, const fs::path& buildDir, std::atomic<bool>& buildCancelled, std::string& buildError);
};
export class Module {
public:
std::atomic<bool> compiled;
bool needsRecompiling;
bool checked = false;
std::vector<std::unique_ptr<ModulePartition>> partitions;
std::string name;
fs::path path;
CRAFTER_API Module(std::string&& name, fs::path&& path);
CRAFTER_API bool Check(const fs::path& pcmDir, fs::file_time_type sourceFloor = fs::file_time_type::min());
CRAFTER_API void Compile(const std::string_view clang, const fs::path& pcmDir, const fs::path& buildDir, std::atomic<bool>& buildCancelled, std::string& buildError);
};
}