diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-11 18:19:07 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-11 18:19:07 +0100 |
commit | eb00551f0e990495c6d7533ed193f459cb449665 (patch) | |
tree | 51ba33b836e6d870378e6d614b1387787e3c7e2b | |
parent | 2b26fff20c1684bc96eac25cfb24e1230f9ca3ce (diff) |
Rename Settings struct to setings
-rw-r--r-- | ctor.cc | 2 | ||||
-rw-r--r-- | src/bootstrap.cc | 2 | ||||
-rw-r--r-- | src/build.cc | 6 | ||||
-rw-r--r-- | src/build.h | 8 | ||||
-rw-r--r-- | src/configure.cc | 10 | ||||
-rw-r--r-- | src/configure.h | 6 | ||||
-rw-r--r-- | src/ctor.h | 8 | ||||
-rw-r--r-- | src/externals_manual.cc | 2 | ||||
-rw-r--r-- | src/externals_manual.h | 4 | ||||
-rw-r--r-- | src/libctor.cc | 2 | ||||
-rw-r--r-- | src/rebuild.cc | 10 | ||||
-rw-r--r-- | src/rebuild.h | 6 | ||||
-rw-r--r-- | src/task.cc | 2 | ||||
-rw-r--r-- | src/task.h | 4 | ||||
-rw-r--r-- | src/task_ar.cc | 2 | ||||
-rw-r--r-- | src/task_ar.h | 4 | ||||
-rw-r--r-- | src/task_cc.cc | 2 | ||||
-rw-r--r-- | src/task_cc.h | 4 | ||||
-rw-r--r-- | src/task_fn.cc | 2 | ||||
-rw-r--r-- | src/task_fn.h | 4 | ||||
-rw-r--r-- | src/task_ld.cc | 2 | ||||
-rw-r--r-- | src/task_ld.h | 4 | ||||
-rw-r--r-- | src/task_so.cc | 2 | ||||
-rw-r--r-- | src/task_so.h | 4 | ||||
-rw-r--r-- | src/tasks.cc | 6 | ||||
-rw-r--r-- | src/tasks.h | 6 | ||||
-rw-r--r-- | src/unittest.cc | 2 | ||||
-rw-r--r-- | src/unittest.h | 4 | ||||
-rw-r--r-- | test/ctor.cc | 2 | ||||
-rw-r--r-- | test/tasks_test.cc | 10 |
30 files changed, 66 insertions, 66 deletions
@@ -5,7 +5,7 @@ namespace { -ctor::BuildConfigurations ctorConfigs(const ctor::Settings& settings) +ctor::BuildConfigurations ctorConfigs(const ctor::settings& settings) { return { diff --git a/src/bootstrap.cc b/src/bootstrap.cc index 3e0adf8..09d6353 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -62,7 +62,7 @@ int main(int argc, char* argv[]) return 1; } - ctor::Settings settings{}; + ctor::settings settings{}; settings.builddir = ctor::getConfiguration(cfg::builddir, settings.builddir); settings.parallel_processes = diff --git a/src/build.cc b/src/build.cc index ab520d2..1fe494b 100644 --- a/src/build.cc +++ b/src/build.cc @@ -17,7 +17,7 @@ using namespace ctor; using namespace std::chrono_literals; -int build(const Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::set<std::shared_ptr<Task>>& tasks, const std::set<std::shared_ptr<Task>>& all_tasks, @@ -156,7 +156,7 @@ std::set<std::shared_ptr<Task>> getDepTasks(std::shared_ptr<Task> task) } } -int build(const Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::set<std::shared_ptr<Task>>& all_tasks, bool dryrun) @@ -194,7 +194,7 @@ int build(const Settings& settings, return 0; } -int build(const Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::vector<Target>& targets, const std::set<std::shared_ptr<Task>>& all_tasks, diff --git a/src/build.h b/src/build.h index 97bcfc6..d74642c 100644 --- a/src/build.h +++ b/src/build.h @@ -11,24 +11,24 @@ #include "tasks.h" namespace ctor { -struct Settings; +struct settings; } // namespace ctor:: //! Dry-run returns number of dirty tasks but otherwise does nothing. -int build(const ctor::Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::set<std::shared_ptr<Task>>& tasks, const std::set<std::shared_ptr<Task>>& all_tasks, bool dryrun = false); //! Dry-run returns number of dirty tasks but otherwise does nothing. -int build(const ctor::Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::set<std::shared_ptr<Task>>& all_tasks, bool dryrun = false); //! Dry-run returns number of dirty tasks but otherwise does nothing. -int build(const ctor::Settings& settings, +int build(const ctor::settings& settings, const std::string& name, const std::vector<Target>& targets, const std::set<std::shared_ptr<Task>>& all_tasks, diff --git a/src/configure.cc b/src/configure.cc index 42d9951..40f4d27 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -172,7 +172,7 @@ public: // helper constant for the visitor template<class> inline constexpr bool always_false_v = false; -int regenerateCache(Settings& settings, +int regenerateCache(ctor::settings& settings, const std::vector<std::string>& args, const std::map<std::string, std::string>& env) { @@ -544,9 +544,9 @@ int regenerateCache(Settings& settings, return 0; } -int configure(const Settings& global_settings, int argc, char* argv[]) +int configure(const ctor::settings& global_settings, int argc, char* argv[]) { - Settings settings{global_settings}; + ctor::settings settings{global_settings}; std::vector<std::string> args; for(int i = 2; i < argc; ++i) // skip command and the first 'configure' arg @@ -590,9 +590,9 @@ int configure(const Settings& global_settings, int argc, char* argv[]) return 0; } -int reconfigure(const Settings& global_settings, int argc, char* argv[]) +int reconfigure(const ctor::settings& global_settings, int argc, char* argv[]) { - Settings settings{global_settings}; + ctor::settings settings{global_settings}; bool no_rerun{false}; diff --git a/src/configure.h b/src/configure.h index cc20707..ac8d721 100644 --- a/src/configure.h +++ b/src/configure.h @@ -9,11 +9,11 @@ #include <vector> namespace ctor { -struct Settings; +struct settings; } // namespace ctor:: extern std::filesystem::path configurationFile;; extern std::filesystem::path configHeaderFile; -int configure(const ctor::Settings& settings, int argc, char* argv[]); -int reconfigure(const ctor::Settings& settings, int argc, char* argv[]); +int configure(const ctor::settings& settings, int argc, char* argv[]); +int reconfigure(const ctor::settings& settings, int argc, char* argv[]); @@ -66,7 +66,7 @@ struct flags std::vector<std::string> asmflags; // flags for asm translator }; -struct Settings +struct settings { std::string builddir{"build"}; std::size_t parallel_processes{1}; @@ -77,7 +77,7 @@ struct BuildConfiguration; using GeneratorCb = std::function<int(const std::string& input, const std::string& output, const BuildConfiguration& config, - const Settings& settings)>; + const ctor::settings& settings)>; struct BuildConfiguration { @@ -94,7 +94,7 @@ struct BuildConfiguration using BuildConfigurations = std::vector<BuildConfiguration>; -int reg(BuildConfigurations (*cb)(const Settings&), +int reg(BuildConfigurations (*cb)(const ctor::settings&), const std::source_location location = std::source_location::current()); // This type will use flags verbatim @@ -113,7 +113,7 @@ struct ExternalConfiguration using ExternalConfigurations = std::vector<ExternalConfiguration>; -int reg(ExternalConfigurations (*cb)(const Settings&), +int reg(ExternalConfigurations (*cb)(const ctor::settings&), const std::source_location location = std::source_location::current()); // Convenience macro - ugly but keeps things simple(r) diff --git a/src/externals_manual.cc b/src/externals_manual.cc index 4ba4743..1fd6b62 100644 --- a/src/externals_manual.cc +++ b/src/externals_manual.cc @@ -15,7 +15,7 @@ using namespace ctor; extern std::map<std::string, std::string> external_includedir; extern std::map<std::string, std::string> external_libdir; -int resolv(const Settings& settings, const ExternalConfiguration& config, +int resolv(const ctor::settings& settings, const ExternalConfiguration& config, const ExternalManual& ext, ctor::flags& flags) { auto tool_chain = getToolChain(config.system); diff --git a/src/externals_manual.h b/src/externals_manual.h index fb165b9..3d8c452 100644 --- a/src/externals_manual.h +++ b/src/externals_manual.h @@ -4,12 +4,12 @@ #pragma once namespace ctor { -struct Settings; +struct settings; struct ExternalConfiguration; struct ExternalManual; struct flags; } // namespace ctor:: -int resolv(const ctor::Settings& settings, +int resolv(const ctor::settings& settings, const ctor::ExternalConfiguration& name, const ctor::ExternalManual& ext, ctor::flags& flags); diff --git a/src/libctor.cc b/src/libctor.cc index 7e39549..67e734a 100644 --- a/src/libctor.cc +++ b/src/libctor.cc @@ -30,7 +30,7 @@ using namespace ctor; int main(int argc, char* argv[]) { - Settings settings{}; + ctor::settings settings{}; settings.builddir = getConfiguration(cfg::builddir, settings.builddir); settings.parallel_processes = diff --git a/src/rebuild.cc b/src/rebuild.cc index daf5443..a1903fe 100644 --- a/src/rebuild.cc +++ b/src/rebuild.cc @@ -23,7 +23,7 @@ std::array<BuildConfigurationEntry, 1024> configFiles; std::size_t numConfigFiles{0}; namespace ctor { -int reg(BuildConfigurations (*cb)(const Settings&), +int reg(BuildConfigurations (*cb)(const ctor::settings&), const std::source_location location) { // NOTE: std::cout cannot be used here @@ -64,7 +64,7 @@ int reg(const char* location) configFiles[numConfigFiles].file = location; configFiles[numConfigFiles].cb = - [](const Settings&){ return std::vector<BuildConfiguration>{}; }; + [](const ctor::settings&){ return std::vector<BuildConfiguration>{}; }; ++numConfigFiles; return 0; @@ -114,7 +114,7 @@ std::array<ExternalConfigurationEntry, 1024> externalConfigFiles; std::size_t numExternalConfigFiles{0}; namespace ctor { -int reg(ExternalConfigurations (*cb)(const Settings&), +int reg(ExternalConfigurations (*cb)(const ctor::settings&), const std::source_location location) { // NOTE: std::cout cannot be used here @@ -149,7 +149,7 @@ bool contains(const std::vector<ctor::source>& sources, const std::string& file) } } -bool recompileCheck(const Settings& global_settings, int argc, char* argv[], +bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[], bool relaunch_allowed) { using namespace std::string_literals; @@ -185,7 +185,7 @@ bool recompileCheck(const Settings& global_settings, int argc, char* argv[], append(config.flags.ldflags, getOption(tool_chain, opt::link, "ctor")); append(config.flags.ldflags, getOption(tool_chain, opt::threads)); - Settings settings{global_settings}; + ctor::settings settings{global_settings}; settings.verbose = -1; // Make check completely silent. settings.builddir += "/ctor"; // override builddir to use ctor subdir diff --git a/src/rebuild.h b/src/rebuild.h index 6d0f6a8..361f4db 100644 --- a/src/rebuild.h +++ b/src/rebuild.h @@ -11,13 +11,13 @@ struct BuildConfigurationEntry { const char* file; - ctor::BuildConfigurations (*cb)(const ctor::Settings&); + ctor::BuildConfigurations (*cb)(const ctor::settings&); }; struct ExternalConfigurationEntry { const char* file; - ctor::ExternalConfigurations (*cb)(const ctor::Settings&); + ctor::ExternalConfigurations (*cb)(const ctor::settings&); }; extern std::array<BuildConfigurationEntry, 1024> configFiles; @@ -30,5 +30,5 @@ int reg(const char* location); int unreg(const char* location); //! Returns true of recompilation was needed. -bool recompileCheck(const ctor::Settings& settings, int argc, char* argv[], +bool recompileCheck(const ctor::settings& settings, int argc, char* argv[], bool relaunch_allowed = true); diff --git a/src/task.cc b/src/task.cc index 4a55d00..b58fdf6 100644 --- a/src/task.cc +++ b/src/task.cc @@ -8,7 +8,7 @@ using namespace ctor; -Task::Task(const BuildConfiguration& config, const Settings& settings, +Task::Task(const BuildConfiguration& config, const ctor::settings& settings, const std::string& sourceDir) : config(config) , output_system(config.system) @@ -24,7 +24,7 @@ enum class State class Task { public: - Task(const ctor::BuildConfiguration& config, const ctor::Settings& settings, + Task(const ctor::BuildConfiguration& config, const ctor::settings& settings, const std::string& sourceDir); virtual ~Task() = default; @@ -79,6 +79,6 @@ protected: ctor::target_type target_type{ctor::target_type::automatic}; ctor::language source_language{ctor::language::automatic}; ctor::output_system output_system{ctor::output_system::host}; - const ctor::Settings& settings; + const ctor::settings& settings; std::string sourceDir; }; diff --git a/src/task_ar.cc b/src/task_ar.cc index d9548cd..c0b156f 100644 --- a/src/task_ar.cc +++ b/src/task_ar.cc @@ -13,7 +13,7 @@ using namespace ctor; TaskAR::TaskAR(const BuildConfiguration& config, - const Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& sourceDir) diff --git a/src/task_ar.h b/src/task_ar.h index 9e8ca8b..e2314c9 100644 --- a/src/task_ar.h +++ b/src/task_ar.h @@ -15,7 +15,7 @@ class TaskAR { public: TaskAR(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& sourceDir); @@ -42,6 +42,6 @@ private: std::filesystem::path flagsFile; const ctor::BuildConfiguration& config; - const ctor::Settings& settings; + const ctor::settings& settings; std::string sourceDir; }; diff --git a/src/task_cc.cc b/src/task_cc.cc index 0733afc..7590729 100644 --- a/src/task_cc.cc +++ b/src/task_cc.cc @@ -14,7 +14,7 @@ using namespace ctor; -TaskCC::TaskCC(const BuildConfiguration& config, const Settings& settings, +TaskCC::TaskCC(const BuildConfiguration& config, const ctor::settings& settings, const std::string& sourceDir, const ctor::source& source) : Task(config, settings, sourceDir) , config(config) diff --git a/src/task_cc.h b/src/task_cc.h index ee53f6d..15144ad 100644 --- a/src/task_cc.h +++ b/src/task_cc.h @@ -15,7 +15,7 @@ class TaskCC { public: TaskCC(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& sourceDir, const ctor::source& source); virtual ~TaskCC() = default; @@ -49,7 +49,7 @@ protected: std::filesystem::path flagsFile; const ctor::BuildConfiguration& config; - const ctor::Settings& settings; + const ctor::settings& settings; std::filesystem::path sourceDir; const ctor::source& _source; }; diff --git a/src/task_fn.cc b/src/task_fn.cc index 4af86a4..839b9c6 100644 --- a/src/task_fn.cc +++ b/src/task_fn.cc @@ -13,7 +13,7 @@ using namespace ctor; -TaskFn::TaskFn(const BuildConfiguration& config, const Settings& settings, +TaskFn::TaskFn(const BuildConfiguration& config, const ctor::settings& settings, const std::string& sourceDir, const ctor::source& source) : Task(config, settings, sourceDir) , config(config) diff --git a/src/task_fn.h b/src/task_fn.h index 565836b..2efe050 100644 --- a/src/task_fn.h +++ b/src/task_fn.h @@ -15,7 +15,7 @@ class TaskFn { public: TaskFn(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& sourceDir, const ctor::source& source); virtual ~TaskFn() = default; @@ -39,6 +39,6 @@ protected: std::filesystem::path _targetFile; const ctor::BuildConfiguration& config; - const ctor::Settings& settings; + const ctor::settings& settings; std::filesystem::path sourceDir; }; diff --git a/src/task_ld.cc b/src/task_ld.cc index 20a4f37..9bbd1d8 100644 --- a/src/task_ld.cc +++ b/src/task_ld.cc @@ -14,7 +14,7 @@ using namespace ctor; TaskLD::TaskLD(const BuildConfiguration& config, - const Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& sourceDir) diff --git a/src/task_ld.h b/src/task_ld.h index 8667d65..11159ad 100644 --- a/src/task_ld.h +++ b/src/task_ld.h @@ -15,7 +15,7 @@ class TaskLD { public: TaskLD(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& _sourceDir); @@ -42,6 +42,6 @@ private: std::filesystem::path flagsFile; const ctor::BuildConfiguration& config; - const ctor::Settings& settings; + const ctor::settings& settings; std::string sourceDir; }; diff --git a/src/task_so.cc b/src/task_so.cc index d7c0820..d00ddae 100644 --- a/src/task_so.cc +++ b/src/task_so.cc @@ -14,7 +14,7 @@ using namespace ctor; TaskSO::TaskSO(const BuildConfiguration& config, - const Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& sourceDir) diff --git a/src/task_so.h b/src/task_so.h index a751226..aacd5c6 100644 --- a/src/task_so.h +++ b/src/task_so.h @@ -15,7 +15,7 @@ class TaskSO { public: TaskSO(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& target, const std::vector<std::string>& objects, const std::string& sourceDir); @@ -42,6 +42,6 @@ private: std::filesystem::path flagsFile; const ctor::BuildConfiguration& config; - const ctor::Settings& settings; + const ctor::settings& settings; std::string sourceDir; }; diff --git a/src/tasks.cc b/src/tasks.cc index a1d4c70..65a3dad 100644 --- a/src/tasks.cc +++ b/src/tasks.cc @@ -21,7 +21,7 @@ using namespace ctor; -const std::deque<Target>& getTargets(const Settings& settings, +const std::deque<Target>& getTargets(const ctor::settings& settings, bool resolve_externals) { static bool initialised{false}; @@ -80,7 +80,7 @@ const std::deque<Target>& getTargets(const Settings& settings, } std::set<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config, - const Settings& settings, + const ctor::settings& settings, const std::string& sourceDir) { std::set<std::shared_ptr<Task>> tasks; @@ -196,7 +196,7 @@ std::shared_ptr<Task> getNextTask(const std::set<std::shared_ptr<Task>>& allTask return nullptr; } -std::set<std::shared_ptr<Task>> getTasks(const Settings& settings, +std::set<std::shared_ptr<Task>> getTasks(const ctor::settings& settings, const std::vector<std::string> names, bool resolve_externals) { diff --git a/src/tasks.h b/src/tasks.h index 26cd757..7700d49 100644 --- a/src/tasks.h +++ b/src/tasks.h @@ -17,7 +17,7 @@ struct Target }; //! Get list of all registered targets -const std::deque<Target>& getTargets(const ctor::Settings& settings, +const std::deque<Target>& getTargets(const ctor::settings& settings, bool resolve_externals = true); //! Returns next dirty task from the dirtyTasks list that has all its dependencies @@ -29,12 +29,12 @@ std::shared_ptr<Task> getNextTask(const std::set<std::shared_ptr<Task>>& allTask //! Get list of tasks filtered by name including each of their direct //! dependency tasks (ie. objects tasks from their sources). -std::set<std::shared_ptr<Task>> getTasks(const ctor::Settings& settings, +std::set<std::shared_ptr<Task>> getTasks(const ctor::settings& settings, const std::vector<std::string> names = {}, bool resolve_externals = true); //! Generate list of targets from a single configuration, including the final //! link target and all its objects files (if any). std::set<std::shared_ptr<Task>> taskFactory(const ctor::BuildConfiguration& config, - const ctor::Settings& settings, + const ctor::settings& settings, const std::string& sourceDir); diff --git a/src/unittest.cc b/src/unittest.cc index 855a2ae..9aceb52 100644 --- a/src/unittest.cc +++ b/src/unittest.cc @@ -11,7 +11,7 @@ using namespace ctor; int runUnitTests(std::set<std::shared_ptr<Task>>& tasks, - const Settings& settings) + const ctor::settings& settings) { bool ok{true}; std::cout << "Running unit-tests:" << std::endl; diff --git a/src/unittest.h b/src/unittest.h index 1ea90dd..2880319 100644 --- a/src/unittest.h +++ b/src/unittest.h @@ -9,8 +9,8 @@ class Task; namespace ctor { -struct Settings; +struct settings; } // namespace ctor:: int runUnitTests(std::set<std::shared_ptr<Task>>& tasks, - const ctor::Settings& settings); + const ctor::settings& settings); diff --git a/test/ctor.cc b/test/ctor.cc index fcb275d..aa9333d 100644 --- a/test/ctor.cc +++ b/test/ctor.cc @@ -5,7 +5,7 @@ namespace { -ctor::BuildConfigurations ctorTestConfigs(const ctor::Settings& settings) +ctor::BuildConfigurations ctorTestConfigs(const ctor::settings& settings) { return { diff --git a/test/tasks_test.cc b/test/tasks_test.cc index 594261d..6cd39b3 100644 --- a/test/tasks_test.cc +++ b/test/tasks_test.cc @@ -7,7 +7,7 @@ using namespace ctor; namespace { -BuildConfigurations ctorTestConfigs1(const Settings&) +BuildConfigurations ctorTestConfigs1(const ctor::settings&) { return { @@ -21,7 +21,7 @@ BuildConfigurations ctorTestConfigs1(const Settings&) }; } -BuildConfigurations ctorTestConfigs2(const Settings&) +BuildConfigurations ctorTestConfigs2(const ctor::settings&) { return { @@ -93,7 +93,7 @@ public: void getTargets_test() { using namespace std::string_literals; - Settings settings{}; + ctor::settings settings{}; const auto& targets = getTargets(settings); uASSERT_EQUAL(4u, targets.size()); @@ -111,7 +111,7 @@ public: void getTasks_test() { using namespace std::string_literals; - Settings settings{ .builddir = "foo" }; + ctor::settings settings{ .builddir = "foo" }; { auto tasks = getTasks(settings); uASSERT_EQUAL(6u, tasks.size()); @@ -141,7 +141,7 @@ public: void getNextTask_test() { using namespace std::string_literals; - Settings settings{}; + ctor::settings settings{}; { // Zero (Empty) std::set<std::shared_ptr<Task>> allTasks; |