summaryrefslogtreecommitdiff
path: root/src/tasks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasks.cc')
-rw-r--r--src/tasks.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/tasks.cc b/src/tasks.cc
index 67bed2b..b44fce8 100644
--- a/src/tasks.cc
+++ b/src/tasks.cc
@@ -18,6 +18,7 @@
#include "task_fn.h"
#include "rebuild.h"
#include "configure.h"
+#include "util.h"
const std::deque<Target>& getTargets(const ctor::settings& settings,
bool resolve_externals)
@@ -92,23 +93,9 @@ std::set<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration& con
{
target_type = ctor::target_type::function;
}
- else if(targetFile.extension() == ".a")
- {
- target_type = ctor::target_type::static_library;
- }
- else if(targetFile.extension() == ".so")
- {
- target_type = ctor::target_type::dynamic_library;
- }
- else if(targetFile.extension() == "")
- {
- target_type = ctor::target_type::executable;
- }
else
{
- std::cerr << "Could not deduce target type from target " <<
- targetFile.string() << " please specify.\n";
- exit(1);
+ target_type = target_type_from_extension(targetFile);
}
}
@@ -140,6 +127,12 @@ std::set<std::shared_ptr<Task>> taskFactory(const ctor::build_configuration& con
// The target_type cannot be Auto
break;
+ case ctor::target_type::unknown:
+ std::cerr << "Could not deduce target type from target " <<
+ targetFile.string() << " please specify.\n";
+ exit(1);
+ break;
+
case ctor::target_type::static_library:
case ctor::target_type::unit_test_library:
tasks.insert(std::make_shared<TaskAR>(config, settings, config.target,