diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-09-12 13:53:36 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-09-12 13:53:36 +0200 |
commit | f7fda8ca8841552b54ce72ed8ca9156cc09368d0 (patch) | |
tree | c736d8a1c9e1ef38e336559d8fb2dc48266ced4f /src | |
parent | 86c7aa6f516bf6ed000f3eef26748997d6677c14 (diff) |
Don't run default build if listing arguments are present.
Diffstat (limited to 'src')
-rw-r--r-- | src/libctor.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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<std::string> add_files; std::vector<std::string> 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<std::string> 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<BuildConfiguration>{};}); @@ -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") |