diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-21 21:39:46 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-06-21 21:39:46 +0200 |
commit | b25810b9668abe8f7cc7db24326a98c1b017966e (patch) | |
tree | 40cda88ffbf8dccfc2d2335783f608966874c58e /task.cc | |
parent | c53e622b648635539e4870fd0c9159c5d8c3be4a (diff) |
Distinguish between host and target builds.
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; + } } |