From f7fda8ca8841552b54ce72ed8ca9156cc09368d0 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 12 Sep 2021 13:53:36 +0200 Subject: Don't run default build if listing arguments are present. --- src/libctor.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libctor.cc b/src/libctor.cc index 9860440..c7a7400 100644 --- a/src/libctor.cc +++ b/src/libctor.cc @@ -42,6 +42,7 @@ int main(int argc, char* argv[]) bool print_configure_db{false}; std::vector add_files; std::vector remove_files; + bool no_default_build{false}; // set to true to prevent empty arg list building 'all' target. bool list_files{false}; bool list_targets{false}; bool no_relaunch{false}; // true means no re-launch after rebuild. @@ -165,6 +166,7 @@ Options: if(list_files) { + no_default_build = true; std::set files; for(std::size_t i = 0; i < numConfigFiles; ++i) { @@ -179,6 +181,7 @@ Options: if(!add_files.empty() || !remove_files.empty()) { + no_default_build = true; for(const auto& add_file : add_files) { reg(add_file.data(), [](){ return std::vector{};}); @@ -202,6 +205,7 @@ Options: if(list_targets) { + no_default_build = true; for(const auto& task : all_tasks) { if(task->targetType() != TargetType::Object) @@ -238,11 +242,13 @@ Options: if(print_configure_cmd) { + no_default_build = true; std::cout << getConfiguration("cmd") << "\n"; } if(print_configure_db) { + no_default_build = true; const auto& c = configuration(); for(const auto& config : c) { @@ -258,7 +264,7 @@ Options: } } - bool build_all{true}; + bool build_all{!no_default_build}; for(const auto& arg : opt.arguments()) { if(arg == "configure") -- cgit v1.2.3