summaryrefslogtreecommitdiff
path: root/src/configure.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure.cc')
-rw-r--r--src/configure.cc64
1 files changed, 23 insertions, 41 deletions
diff --git a/src/configure.cc b/src/configure.cc
index 98f68d7..cc963f8 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -325,7 +325,6 @@ int regenerateCache(const Settings& default_settings,
std::string build_ar = locate(build_arch, ar_prog);
std::string build_ld = locate(build_arch, ld_prog);
- // TODO: Centralize
// Resolv externals
ExternalConfigurations externalConfigs;
for(std::size_t i = 0; i < numExternalConfigFiles; ++i)
@@ -379,69 +378,52 @@ int regenerateCache(const Settings& default_settings,
}
istr << " },\n";
- istr << " .externals = {\n";
+ istr << " .externals = {\n";
for(const auto& externalConfig : externalConfigs)
{
- if(!externalConfig.cflags.empty())
- {
- istr << " { \"" << externalConfig.name << "-cflags\",\n";
- istr << " {\n";
- for(const auto& cflag : externalConfig.cflags)
- {
- istr << " \"" << cflag << "\",\n";
- }
- istr << " },\n";
- istr << " },\n";
- }
+ istr << " { \"" << externalConfig.name << "\", {\n";
- if(!externalConfig.cxxflags.empty())
+ if(!externalConfig.flags.cxxflags.empty())
{
- istr << " { \"" << externalConfig.name << "-cxxflags\",\n";
- istr << " {\n";
- for(const auto& cxxflag : externalConfig.cxxflags)
+ istr << " .cxxflags = {";
+ for(const auto& flag : externalConfig.flags.cxxflags)
{
- istr << " \"" << cxxflag << "\",\n";
+ istr << "\"" << flag << "\",";
}
- istr << " },\n";
- istr << " },\n";
+ istr << "},\n";
}
- if(!externalConfig.ldflags.empty())
+ if(!externalConfig.flags.cflags.empty())
{
- istr << " { \"" << externalConfig.name << "-ldflags\",\n";
- istr << " {\n";
- for(const auto& ldflag : externalConfig.ldflags)
+ istr << " .cflags = {";
+ for(const auto& flag : externalConfig.flags.cflags)
{
- istr << " \"" << ldflag << "\",\n";
+ istr << "\"" << flag << "\",";
}
- istr << " },\n";
- istr << " },\n";
+ istr << "},\n";
}
- if(!externalConfig.libs.empty())
+ if(!externalConfig.flags.ldflags.empty())
{
- istr << " { \"" << externalConfig.name << "-libs\",\n";
- istr << " {\n";
- for(const auto& lib : externalConfig.libs)
+ istr << " .ldflags = {";
+ for(const auto& flag : externalConfig.flags.ldflags)
{
- istr << " \"" << lib << "\",\n";
+ istr << "\"" << flag << "\",";
}
- istr << " },\n";
- istr << " },\n";
+ istr << "},\n";
}
- if(!externalConfig.asmflags.empty())
+ if(!externalConfig.flags.asmflags.empty())
{
- istr << " { \"" << externalConfig.name << "-asmflags\",\n";
- istr << " {\n";
- for(const auto& asmflag : externalConfig.asmflags)
+ istr << " .asmflags = {";
+ for(const auto& flag : externalConfig.flags.asmflags)
{
- istr << " \"" << asmflag << "\",\n";
+ istr << "\"" << flag << "\",";
}
- istr << " },\n";
- istr << " },\n";
+ istr << "},\n";
}
+ istr << " }},\n";
}
istr << " },\n";