diff options
Diffstat (limited to 'task.cc')
-rw-r--r-- | task.cc | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -7,6 +7,7 @@ Task::Task(const BuildConfiguration& config, const std::vector<std::string>& depends) : dependsStr(depends) , config(config) + , output_system(config.system) { } @@ -97,7 +98,39 @@ TargetType Task::targetType() const return target_type; } -Language Task::language() const +Language Task::sourceLanguage() const { - return _language; + return source_language; +} + +OutputSystem Task::outputSystem() const +{ + return output_system; +} + +std::string Task::compiler() const +{ + switch(sourceLanguage()) + { + case Language::C: + switch(outputSystem()) + { + case OutputSystem::Target: + return getConfiguration(cfg::target_cc, "/usr/bin/gcc"); + case OutputSystem::BuildHost: + return getConfiguration(cfg::host_cc, "/usr/bin/gcc"); + } + case Language::Cpp: + switch(outputSystem()) + { + case OutputSystem::Target: + return getConfiguration(cfg::target_cpp, "/usr/bin/g++"); + case OutputSystem::BuildHost: + return getConfiguration(cfg::host_cpp, "/usr/bin/g++"); + } + default: + std::cerr << "Unknown CC target type\n"; + exit(1); + break; + } } |