From 5b7f983b3912a8d0fbeaf22f7fe0e2c5f1e0ff01 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 4 Oct 2026 12:56:13 +0200 Subject: Generate a dependency tree for rake --- include/elna/gcc/elna-module-loader.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/elna/gcc/elna-module-loader.h b/include/elna/gcc/elna-module-loader.h index 5f5aab6..c49b880 100644 --- a/include/elna/gcc/elna-module-loader.h +++ b/include/elna/gcc/elna-module-loader.h @@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see #include #include #include +#include #include #include "config.h" @@ -35,6 +36,19 @@ namespace elna::gcc // the module loader when resolving import paths. extern std::vector elna_include_dirs; + struct dependency_options + { + bool enabled = false; + bool only_dependencies = false; + bool phony = false; + std::string output_file; + std::vector targets; + }; + + extern dependency_options elna_deps_options; + + std::string munge_make_string(std::string_view str, bool is_target); + /** * Module loader tying the boot compilation pipeline to the GCC driver. * @@ -46,10 +60,21 @@ namespace elna::gcc class module_loader { const std::shared_ptr symbols; + std::vector m_dependencies; public: explicit module_loader(const std::shared_ptr& symbols); + const std::vector& dependencies() const + { + return this->m_dependencies; + } + + void clear_dependencies() + { + this->m_dependencies.clear(); + } + /** * Searches the include directories for \p relative. * @@ -61,7 +86,7 @@ namespace elna::gcc * * \return The resolved module path, canonical if found. */ - static std::filesystem::path resolve(const std::filesystem::path& relative, + std::filesystem::path resolve(const std::filesystem::path& relative, const boot::source_position& position, const std::filesystem::path& module); /** -- cgit v1.2.3