summaryrefslogtreecommitdiff
path: root/libcppbuild.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-22 17:51:15 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-22 17:51:15 +0200
commitf8a52e96685d636be956b5f89d6f493856c0810f (patch)
treec605c3f240ca8dd3d32445fefb2fafe6becac542 /libcppbuild.cc
parentb25810b9668abe8f7cc7db24326a98c1b017966e (diff)
Add option to print entire configure parameter database.
Diffstat (limited to 'libcppbuild.cc')
-rw-r--r--libcppbuild.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/libcppbuild.cc b/libcppbuild.cc
index 5cd4dc9..5e63029 100644
--- a/libcppbuild.cc
+++ b/libcppbuild.cc
@@ -409,6 +409,7 @@ int main(int argc, char* argv[])
bool write_compilation_database{false};
std::string compilation_database;
bool print_configure_cmd{false};
+ bool print_configure_db{false};
dg::Options opt;
int key{256};
@@ -450,6 +451,13 @@ int main(int argc, char* argv[])
return 0;
});
+ opt.add("configure-db", no_argument, key++,
+ "Print entire configure parameter database.",
+ [&]() {
+ print_configure_db = true;
+ return 0;
+ });
+
opt.add("database", required_argument, 'd',
"Write compilation database json file.",
[&]() {
@@ -507,6 +515,16 @@ int main(int argc, char* argv[])
return 0;
}
+ if(print_configure_db)
+ {
+ const auto& c = configuration();
+ for(const auto& config : c)
+ {
+ std::cout << config.first << ": " << config.second << "\n";
+ }
+ return 0;
+ }
+
for(auto task : tasks)
{
if(task->registerDepTasks(tasks))