From c0eacf8e85003844b95e71b9004fa464d4586a38 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 14 Oct 2021 22:19:26 +0200 Subject: Use dependency system and build system for compiling ctor on config changes. --- src/libctor.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/libctor.cc') 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.", [&]() { -- cgit v1.2.3