aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
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);
/**