aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-04 12:56:13 +0200
committerEugen Wissner <belka@caraus.de>2026-10-04 12:56:13 +0200
commit5b7f983b3912a8d0fbeaf22f7fe0e2c5f1e0ff01 (patch)
tree138f5e022066e3ad013c795c38dc4a739c3e93af /include
parent8a6ed3a4ddf9c4e16bb4ddc3b8c5094bb937598b (diff)
downloadelna-5b7f983b3912a8d0fbeaf22f7fe0e2c5f1e0ff01.tar.gz
Generate a dependency tree for rake
Diffstat (limited to 'include')
-rw-r--r--include/elna/gcc/elna-module-loader.h27
1 files changed, 26 insertions, 1 deletions
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 <filesystem>
#include <memory>
#include <string>
+#include <string_view>
#include <vector>
#include "config.h"
@@ -35,6 +36,19 @@ namespace elna::gcc
// the module loader when resolving import paths.
extern std::vector<std::string> elna_include_dirs;
+ struct dependency_options
+ {
+ bool enabled = false;
+ bool only_dependencies = false;
+ bool phony = false;
+ std::string output_file;
+ std::vector<std::string> 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<symbol_table> symbols;
+ std::vector<std::filesystem::path> m_dependencies;
public:
explicit module_loader(const std::shared_ptr<symbol_table>& symbols);
+ const std::vector<std::filesystem::path>& 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);
/**