summaryrefslogtreecommitdiff
path: root/src/tools.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.cc')
-rw-r--r--src/tools.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools.cc b/src/tools.cc
index 476386b..28d3903 100644
--- a/src/tools.cc
+++ b/src/tools.cc
@@ -80,6 +80,10 @@ std::ostream& operator<<(std::ostream& stream, const ctor::ar_opt& opt)
// Adding to this enum should also imply adding to the unit-tests below
switch(opt)
{
+ case ctor::ar_opt::replace: stream << "ctor::ar_opt::replace"; break;
+ case ctor::ar_opt::add_index: stream << "ctor::ar_opt::add_index"; break;
+ case ctor::ar_opt::create: stream << "ctor::ar_opt::create"; break;
+ case ctor::ar_opt::output: stream << "ctor::ar_opt::output"; break;
case ctor::ar_opt::custom: stream << "ctor::ar_opt::custom"; break;
}
@@ -174,6 +178,11 @@ ctor::ld_flag ld_option(const std::string& flag)
return { ctor::ld_opt::custom, flag };
}
+ctor::ar_flag ar_option(const std::string& flag)
+{
+ return { ctor::ar_opt::custom, flag };
+}
+
std::vector<std::string> cxx_option(ctor::cxx_opt opt, const std::string& arg)
{
switch(opt)
@@ -280,6 +289,14 @@ std::vector<std::string> ar_option(ctor::ar_opt opt, const std::string& arg)
{
switch(opt)
{
+ case ctor::ar_opt::replace:
+ return {"-r"};
+ case ctor::ar_opt::add_index:
+ return {"-s"};
+ case ctor::ar_opt::create:
+ return {"-c"};
+ case ctor::ar_opt::output:
+ return {arg};
case ctor::ar_opt::custom:
return {arg};
}
@@ -494,6 +511,7 @@ ctor::ar_flag ar_option(const std::string& flag, ctor::toolchain toolchain)
{
case ctor::toolchain::gcc:
case ctor::toolchain::clang:
+ return gcc::ar_option(flag);
case ctor::toolchain::any:
case ctor::toolchain::none:
break;