summaryrefslogtreecommitdiff
path: root/src/bootstrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r--src/bootstrap.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bootstrap.cc b/src/bootstrap.cc
index 09d6353..1fb3807 100644
--- a/src/bootstrap.cc
+++ b/src/bootstrap.cc
@@ -22,20 +22,18 @@
std::filesystem::path configurationFile("configuration.cc");
std::filesystem::path configHeaderFile("config.h");
-namespace ctor {
-const Configuration default_configuration{};
-const Configuration& configuration()
+const ctor::configuration default_configuration{};
+const ctor::configuration& ctor::get_configuration()
{
return default_configuration;
}
-bool hasConfiguration(const std::string& key)
+bool ctor::configuration::has(const std::string& key) const
{
return false;
}
-const std::string& getConfiguration(const std::string& key,
- const std::string& defaultValue)
+const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const
{
if(key == cfg::host_cxx && std::getenv("CXX"))
{
@@ -49,9 +47,8 @@ const std::string& getConfiguration(const std::string& key,
return s;
}
- return defaultValue;
+ return default_value;
}
-} // namespace ctor::
int main(int argc, char* argv[])
{
@@ -64,7 +61,8 @@ int main(int argc, char* argv[])
ctor::settings settings{};
- settings.builddir = ctor::getConfiguration(cfg::builddir, settings.builddir);
+ const auto& c = ctor::get_configuration();
+ settings.builddir = c.get(cfg::builddir, settings.builddir);
settings.parallel_processes =
std::max(1u, std::thread::hardware_concurrency() * 2 - 1);
settings.verbose = 0;