summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-01-10 16:00:36 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2023-01-11 17:13:24 +0100
commit1484d74c1dfd24cfe5b6f13f76d58ff395e4d253 (patch)
tree2f71f2aa6d6dd29eda51924f985de7f9caee78c0 /src/configure.cc
parentf31661d392c1332ceb0edcbc9fd35f4cb49bb50d (diff)
Put ctor.h contents in ctor namespace.
Diffstat (limited to 'src/configure.cc')
-rw-r--r--src/configure.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/configure.cc b/src/configure.cc
index 25403f7..28049ae 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -16,25 +16,25 @@
#include "rebuild.h"
#include "externals.h"
+using namespace ctor;
+
std::filesystem::path configurationFile("configuration.cc");
std::filesystem::path configHeaderFile("config.h");
std::map<std::string, std::string> external_includedir;
std::map<std::string, std::string> external_libdir;
+namespace ctor {
const Configuration default_configuration{};
const Configuration& __attribute__((weak)) configuration()
{
return default_configuration;
}
-namespace ctor
-{
std::optional<std::string> includedir;
std::optional<std::string> libdir;
std::optional<std::string> builddir;
std::map<std::string, std::string> conf_values;
-}
bool hasConfiguration(const std::string& key)
{
@@ -93,6 +93,7 @@ const std::string& getConfiguration(const std::string& key,
return defaultValue;
}
+} // namespace ctor::
std::string locate(const std::string& arch, const std::string& app)
{
@@ -419,6 +420,7 @@ int regenerateCache(Settings& settings,
{
std::ofstream istr(configurationFile);
istr << "#include <ctor.h>\n\n";
+ istr << "namespace ctor {\n";
istr << "const Configuration& configuration()\n";
istr << "{\n";
istr << " static Configuration cfg =\n";
@@ -528,7 +530,8 @@ int regenerateCache(Settings& settings,
istr << " },\n";
istr << " };\n";
istr << " return cfg;\n";
- istr << "}\n\n";
+ istr << "}\n";
+ istr << "} // namespace ctor::\n\n";
}
{