summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure.cc')
-rw-r--r--src/configure.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/configure.cc b/src/configure.cc
index 8e88092..3bb2d48 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -16,6 +16,7 @@
#include "rebuild.h"
#include "externals.h"
#include "tools.h"
+#include "util.h"
std::filesystem::path configurationFile("configuration.cc");
std::filesystem::path configHeaderFile("config.h");
@@ -495,38 +496,38 @@ int regenerateCache(ctor::settings& settings,
istr << " .args = {";
for(const auto& arg : args)
{
- istr << "\"" << arg << "\",";
+ istr << "\"" << esc(arg) << "\",";
}
istr << "},\n";
istr << " .env = {";
for(const auto& e : env)
{
- istr << "{\"" << e.first << "\", \"" << e.second << "\"}, ";
+ istr << "{\"" << esc(e.first) << "\", \"" << esc(e.second) << "\"}, ";
}
istr << "},\n";
istr << " .tools = {\n";
if(!builddir.empty())
{
- istr << " { \"" << ctor::cfg::builddir << "\", \"" << builddir << "\" },\n";
+ istr << " { \"" << ctor::cfg::builddir << "\", \"" << esc(builddir) << "\" },\n";
ctor::builddir = builddir;
}
- istr << " { \"" << ctor::cfg::host_cc << "\", \"" << host_cc << "\" },\n";
- istr << " { \"" << ctor::cfg::host_cxx << "\", \"" << host_cxx << "\" },\n";
- istr << " { \"" << ctor::cfg::host_ar << "\", \"" << host_ar << "\" },\n";
- istr << " { \"" << ctor::cfg::host_ld << "\", \"" << host_ld << "\" },\n";
- istr << " { \"" << ctor::cfg::build_cc << "\", \"" << build_cc << "\" },\n";
- istr << " { \"" << ctor::cfg::build_cxx << "\", \"" << build_cxx << "\" },\n";
- istr << " { \"" << ctor::cfg::build_ar << "\", \"" << build_ar << "\" },\n";
- istr << " { \"" << ctor::cfg::build_ld << "\", \"" << build_ld << "\" },\n";
+ istr << " { \"" << ctor::cfg::host_cc << "\", \"" << esc(host_cc) << "\" },\n";
+ istr << " { \"" << ctor::cfg::host_cxx << "\", \"" << esc(host_cxx) << "\" },\n";
+ istr << " { \"" << ctor::cfg::host_ar << "\", \"" << esc(host_ar) << "\" },\n";
+ istr << " { \"" << ctor::cfg::host_ld << "\", \"" << esc(host_ld) << "\" },\n";
+ istr << " { \"" << ctor::cfg::build_cc << "\", \"" << esc(build_cc) << "\" },\n";
+ istr << " { \"" << ctor::cfg::build_cxx << "\", \"" << esc(build_cxx) << "\" },\n";
+ istr << " { \"" << ctor::cfg::build_ar << "\", \"" << esc(build_ar) << "\" },\n";
+ istr << " { \"" << ctor::cfg::build_ld << "\", \"" << esc(build_ld) << "\" },\n";
if(!ctor_includedir.empty())
{
- istr << " { \"" << ctor::cfg::ctor_includedir << "\", \"" << ctor_includedir << "\" },\n";
+ istr << " { \"" << ctor::cfg::ctor_includedir << "\", \"" << esc(ctor_includedir) << "\" },\n";
ctor::includedir = ctor_includedir;
}
if(!ctor_libdir.empty())
{
- istr << " { \"" << ctor::cfg::ctor_libdir << "\", \"" << ctor_libdir << "\" },\n";
+ istr << " { \"" << ctor::cfg::ctor_libdir << "\", \"" << esc(ctor_libdir) << "\" },\n";
ctor::libdir = ctor_libdir;
}
@@ -535,7 +536,7 @@ int regenerateCache(ctor::settings& settings,
for(const auto& ext : externalConfigs)
{
- istr << " { \"" << ext.name << "\", {\n";
+ istr << " { \"" << esc(ext.name) << "\", {\n";
ctor::flags resolved_flags;
if(std::holds_alternative<ctor::external_manual>(ext.external))
{