summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
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";
}
{