summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-01-11 18:30:11 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2023-01-11 18:30:11 +0100
commitf10bfc1bff1dc2792b4905c27dd22c0999162fac (patch)
treebacd83a6aa721d1427d84ef50493235fbda5b343
parenteb00551f0e990495c6d7533ed193f459cb449665 (diff)
Rename BuildConfiguration struct to build_configuration
-rw-r--r--ctor.cc2
-rw-r--r--src/ctor.h10
-rw-r--r--src/rebuild.cc6
-rw-r--r--src/rebuild.h2
-rw-r--r--src/task.cc4
-rw-r--r--src/task.h6
-rw-r--r--src/task_ar.cc2
-rw-r--r--src/task_ar.h4
-rw-r--r--src/task_cc.cc2
-rw-r--r--src/task_cc.h4
-rw-r--r--src/task_fn.cc2
-rw-r--r--src/task_fn.h4
-rw-r--r--src/task_ld.cc2
-rw-r--r--src/task_ld.h4
-rw-r--r--src/task_so.cc2
-rw-r--r--src/task_so.h4
-rw-r--r--src/tasks.cc2
-rw-r--r--src/tasks.h4
-rw-r--r--test/ctor.cc2
-rw-r--r--test/tasks_test.cc4
20 files changed, 36 insertions, 36 deletions
diff --git a/ctor.cc b/ctor.cc
index af412af..c9faa5e 100644
--- a/ctor.cc
+++ b/ctor.cc
@@ -5,7 +5,7 @@
namespace
{
-ctor::BuildConfigurations ctorConfigs(const ctor::settings& settings)
+ctor::build_configurations ctorConfigs(const ctor::settings& settings)
{
return
{
diff --git a/src/ctor.h b/src/ctor.h
index 3a6adce..c78e92e 100644
--- a/src/ctor.h
+++ b/src/ctor.h
@@ -73,13 +73,13 @@ struct settings
int verbose{0}; // -1: completely silent, 0: normal, 1: verbose, ...
};
-struct BuildConfiguration;
+struct build_configuration;
using GeneratorCb = std::function<int(const std::string& input,
const std::string& output,
- const BuildConfiguration& config,
+ const build_configuration& config,
const ctor::settings& settings)>;
-struct BuildConfiguration
+struct build_configuration
{
std::string name; // Name - used for referring in other configurations.
ctor::target_type type{ctor::target_type::automatic};
@@ -92,9 +92,9 @@ struct BuildConfiguration
GeneratorCb function;
};
-using BuildConfigurations = std::vector<BuildConfiguration>;
+using build_configurations = std::vector<build_configuration>;
-int reg(BuildConfigurations (*cb)(const ctor::settings&),
+int reg(ctor::build_configurations (*cb)(const ctor::settings&),
const std::source_location location = std::source_location::current());
// This type will use flags verbatim
diff --git a/src/rebuild.cc b/src/rebuild.cc
index a1903fe..c766ae4 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 ctor::settings&),
+int reg(ctor::build_configurations (*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 ctor::settings&){ return std::vector<BuildConfiguration>{}; };
+ [](const ctor::settings&){ return std::vector<ctor::build_configuration>{}; };
++numConfigFiles;
return 0;
@@ -159,7 +159,7 @@ bool recompileCheck(const ctor::settings& global_settings, int argc, char* argv[
std::cout << "Recompile check (" << numConfigFiles << "):\n";
}
- BuildConfiguration config;
+ ctor::build_configuration config;
config.name = "ctor";
config.system = ctor::output_system::build;
diff --git a/src/rebuild.h b/src/rebuild.h
index 361f4db..c3c3b7a 100644
--- a/src/rebuild.h
+++ b/src/rebuild.h
@@ -11,7 +11,7 @@
struct BuildConfigurationEntry
{
const char* file;
- ctor::BuildConfigurations (*cb)(const ctor::settings&);
+ ctor::build_configurations (*cb)(const ctor::settings&);
};
struct ExternalConfigurationEntry
diff --git a/src/task.cc b/src/task.cc
index b58fdf6..cff850e 100644
--- a/src/task.cc
+++ b/src/task.cc
@@ -8,7 +8,7 @@
using namespace ctor;
-Task::Task(const BuildConfiguration& config, const ctor::settings& settings,
+Task::Task(const ctor::build_configuration& config, const ctor::settings& settings,
const std::string& sourceDir)
: config(config)
, output_system(config.system)
@@ -109,7 +109,7 @@ State Task::state() const
return task_state.load();
}
-const BuildConfiguration& Task::buildConfig() const
+const ctor::build_configuration& Task::buildConfig() const
{
return config;
}
diff --git a/src/task.h b/src/task.h
index 92999f6..9e99f25 100644
--- a/src/task.h
+++ b/src/task.h
@@ -24,7 +24,7 @@ enum class State
class Task
{
public:
- Task(const ctor::BuildConfiguration& config, const ctor::settings& settings,
+ Task(const ctor::build_configuration& config, const ctor::settings& settings,
const std::string& sourceDir);
virtual ~Task() = default;
@@ -57,7 +57,7 @@ public:
//! Returns a reference to the originating build config.
//! Note: the build config of a derived task will be that of its parent
//! (target) task.
- const ctor::BuildConfiguration& buildConfig() const;
+ const ctor::build_configuration& buildConfig() const;
ctor::target_type targetType() const;
ctor::language sourceLanguage() const;
@@ -75,7 +75,7 @@ protected:
std::vector<std::string> dependsStr;
std::set<std::shared_ptr<Task>> dependsTasks;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
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};
diff --git a/src/task_ar.cc b/src/task_ar.cc
index c0b156f..890209e 100644
--- a/src/task_ar.cc
+++ b/src/task_ar.cc
@@ -12,7 +12,7 @@
using namespace ctor;
-TaskAR::TaskAR(const BuildConfiguration& config,
+TaskAR::TaskAR(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
diff --git a/src/task_ar.h b/src/task_ar.h
index e2314c9..601afeb 100644
--- a/src/task_ar.h
+++ b/src/task_ar.h
@@ -14,7 +14,7 @@ class TaskAR
: public Task
{
public:
- TaskAR(const ctor::BuildConfiguration& config,
+ TaskAR(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
@@ -41,7 +41,7 @@ private:
std::filesystem::path _targetFile;
std::filesystem::path flagsFile;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
const ctor::settings& settings;
std::string sourceDir;
};
diff --git a/src/task_cc.cc b/src/task_cc.cc
index 7590729..a8caba0 100644
--- a/src/task_cc.cc
+++ b/src/task_cc.cc
@@ -14,7 +14,7 @@
using namespace ctor;
-TaskCC::TaskCC(const BuildConfiguration& config, const ctor::settings& settings,
+TaskCC::TaskCC(const ctor::build_configuration& 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 15144ad..70bb13c 100644
--- a/src/task_cc.h
+++ b/src/task_cc.h
@@ -14,7 +14,7 @@ class TaskCC
: public Task
{
public:
- TaskCC(const ctor::BuildConfiguration& config,
+ TaskCC(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& sourceDir, const ctor::source& source);
virtual ~TaskCC() = default;
@@ -48,7 +48,7 @@ protected:
std::filesystem::path depsFile;
std::filesystem::path flagsFile;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
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 839b9c6..7757d7c 100644
--- a/src/task_fn.cc
+++ b/src/task_fn.cc
@@ -13,7 +13,7 @@
using namespace ctor;
-TaskFn::TaskFn(const BuildConfiguration& config, const ctor::settings& settings,
+TaskFn::TaskFn(const ctor::build_configuration& 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 2efe050..1bad32c 100644
--- a/src/task_fn.h
+++ b/src/task_fn.h
@@ -14,7 +14,7 @@ class TaskFn
: public Task
{
public:
- TaskFn(const ctor::BuildConfiguration& config,
+ TaskFn(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& sourceDir, const ctor::source& source);
virtual ~TaskFn() = default;
@@ -38,7 +38,7 @@ protected:
std::filesystem::path sourceFile;
std::filesystem::path _targetFile;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
const ctor::settings& settings;
std::filesystem::path sourceDir;
};
diff --git a/src/task_ld.cc b/src/task_ld.cc
index 9bbd1d8..5e1f8c6 100644
--- a/src/task_ld.cc
+++ b/src/task_ld.cc
@@ -13,7 +13,7 @@
using namespace ctor;
-TaskLD::TaskLD(const BuildConfiguration& config,
+TaskLD::TaskLD(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
diff --git a/src/task_ld.h b/src/task_ld.h
index 11159ad..dbe7db1 100644
--- a/src/task_ld.h
+++ b/src/task_ld.h
@@ -14,7 +14,7 @@ class TaskLD
: public Task
{
public:
- TaskLD(const ctor::BuildConfiguration& config,
+ TaskLD(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
@@ -41,7 +41,7 @@ private:
std::filesystem::path _targetFile;
std::filesystem::path flagsFile;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
const ctor::settings& settings;
std::string sourceDir;
};
diff --git a/src/task_so.cc b/src/task_so.cc
index d00ddae..15df61f 100644
--- a/src/task_so.cc
+++ b/src/task_so.cc
@@ -13,7 +13,7 @@
using namespace ctor;
-TaskSO::TaskSO(const BuildConfiguration& config,
+TaskSO::TaskSO(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
diff --git a/src/task_so.h b/src/task_so.h
index aacd5c6..60af225 100644
--- a/src/task_so.h
+++ b/src/task_so.h
@@ -14,7 +14,7 @@ class TaskSO
: public Task
{
public:
- TaskSO(const ctor::BuildConfiguration& config,
+ TaskSO(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& target,
const std::vector<std::string>& objects,
@@ -41,7 +41,7 @@ private:
std::filesystem::path _targetFile;
std::filesystem::path flagsFile;
- const ctor::BuildConfiguration& config;
+ const ctor::build_configuration& config;
const ctor::settings& settings;
std::string sourceDir;
};
diff --git a/src/tasks.cc b/src/tasks.cc
index 65a3dad..ff3aaec 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -79,7 +79,7 @@ const std::deque<Target>& getTargets(const ctor::settings& settings,
return targets;
}
-std::set<std::shared_ptr<Task>> taskFactory(const BuildConfiguration& config,
+std::set<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& sourceDir)
{
diff --git a/src/tasks.h b/src/tasks.h
index 7700d49..ed1bf60 100644
--- a/src/tasks.h
+++ b/src/tasks.h
@@ -12,7 +12,7 @@
struct Target
{
- ctor::BuildConfiguration config;
+ ctor::build_configuration config;
std::string path;
};
@@ -35,6 +35,6 @@ std::set<std::shared_ptr<Task>> getTasks(const ctor::settings& settings,
//! 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,
+std::set<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration& config,
const ctor::settings& settings,
const std::string& sourceDir);
diff --git a/test/ctor.cc b/test/ctor.cc
index aa9333d..a2ad64d 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -5,7 +5,7 @@
namespace
{
-ctor::BuildConfigurations ctorTestConfigs(const ctor::settings& settings)
+ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
{
return
{
diff --git a/test/tasks_test.cc b/test/tasks_test.cc
index 6cd39b3..57d30e3 100644
--- a/test/tasks_test.cc
+++ b/test/tasks_test.cc
@@ -7,7 +7,7 @@ using namespace ctor;
namespace
{
-BuildConfigurations ctorTestConfigs1(const ctor::settings&)
+ctor::build_configurations ctorTestConfigs1(const ctor::settings&)
{
return
{
@@ -21,7 +21,7 @@ BuildConfigurations ctorTestConfigs1(const ctor::settings&)
};
}
-BuildConfigurations ctorTestConfigs2(const ctor::settings&)
+ctor::build_configurations ctorTestConfigs2(const ctor::settings&)
{
return
{