summaryrefslogtreecommitdiff
path: root/src/libctor.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-10-14 22:19:26 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-10-14 22:19:26 +0200
commitc0eacf8e85003844b95e71b9004fa464d4586a38 (patch)
treea407dc8ec3830cb01faf3d5153c8741f9b19e1c1 /src/libctor.cc
parent87aad8c76eb2371720c9aceef7516ecb0859ecdf (diff)
Use dependency system and build system for compiling ctor on config changes.
Diffstat (limited to 'src/libctor.cc')
-rw-r--r--src/libctor.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/libctor.cc b/src/libctor.cc
index 4d0d6d9..ca60de2 100644
--- a/src/libctor.cc
+++ b/src/libctor.cc
@@ -26,19 +26,19 @@
#include "tasks.h"
#include "build.h"
#include "unittest.h"
+
int main(int argc, char* argv[])
{
- if(argc > 1 && std::string(argv[1]) == "configure")
- {
- return configure(argc, argv);
- }
-
Settings settings{};
- settings.builddir = getConfiguration(cfg::builddir, "build");
+ settings.builddir = getConfiguration(cfg::builddir, settings.builddir);
settings.parallel_processes =
std::max(1u, std::thread::hardware_concurrency() * 2 - 1);
- settings.verbose = 0;
+
+ if(argc > 1 && std::string(argv[1]) == "configure")
+ {
+ return configure(settings, argc, argv);
+ }
bool write_compilation_database{false};
std::string compilation_database;
@@ -85,6 +85,13 @@ int main(int argc, char* argv[])
return 0;
});
+ opt.add("quiet", no_argument, 'q',
+ "Be completely silent.",
+ [&]() {
+ settings.verbose = -1;
+ return 0;
+ });
+
opt.add("add", required_argument, 'a',
"Add specified file to the build configurations.",
[&]() {