diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-12-15 11:05:31 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-09 17:22:54 +0100 |
commit | 55ab1f564286c6f3e986bf68ebb271132a749c6f (patch) | |
tree | bf6b35923b3a2e85cb061c78ea929ff58933c720 /src/configure.cc | |
parent | de26eed5157a1b5efc2a72668b4f4a22638f2774 (diff) |
Add clang support.
Diffstat (limited to 'src/configure.cc')
-rw-r--r-- | src/configure.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/configure.cc b/src/configure.cc index 86538ab..50a7c32 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -32,6 +32,7 @@ namespace ctor { std::optional<std::string> includedir; std::optional<std::string> libdir; +std::map<std::string, std::string> conf_values; } bool hasConfiguration(const std::string& key) @@ -46,6 +47,11 @@ bool hasConfiguration(const std::string& key) return true; } + if(ctor::conf_values.find(key) != ctor::conf_values.end()) + { + return true; + } + const auto& c = configuration(); return c.tools.find(key) != c.tools.end(); } @@ -63,6 +69,11 @@ const std::string& getConfiguration(const std::string& key, return *ctor::libdir; } + if(ctor::conf_values.find(key) != ctor::conf_values.end()) + { + return ctor::conf_values[key]; + } + const auto& c = configuration(); if(hasConfiguration(key)) { @@ -376,6 +387,18 @@ int regenerateCache(const Settings& default_settings, std::string build_ar = locate(build_arch, ar_prog); std::string build_ld = locate(build_arch, ld_prog); + // Store current values for execution in this execution context. + if(!ctor_includedir.empty()) + { + ctor::conf_values[cfg::ctor_includedir] = ctor_includedir; + } + if(!ctor_libdir.empty()) + { + ctor::conf_values[cfg::ctor_libdir] = ctor_libdir; + } + ctor::conf_values[cfg::host_cxx] = host_cxx; + ctor::conf_values[cfg::build_cxx] = build_cxx; + std::cout << "Writing results to: " << configurationFile.string() << "\n"; { std::ofstream istr(configurationFile); |