diff options
Diffstat (limited to 'src/task_cc.cc')
-rw-r--r-- | src/task_cc.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/task_cc.cc b/src/task_cc.cc index b9edcf7..97e99af 100644 --- a/src/task_cc.cc +++ b/src/task_cc.cc @@ -191,7 +191,33 @@ int TaskCC::runInner() std::cout << output << std::flush; } + auto toolchain = getToolChain(config.system); const auto& cfg = ctor::get_configuration(); + switch(sourceLanguage()) + { + case ctor::language::c: + { + auto cflags = cfg.getenv("CFLAGS"); + if(!cflags.empty()) + { + append(args, c_option(toolchain, ctor::c_opt::custom, cflags)); + } + } + break; + case ctor::language::cpp: + { + auto cxxflags = cfg.getenv("CXXFLAGS"); + if(!cxxflags.empty()) + { + append(args, cxx_option(toolchain, ctor::cxx_opt::custom, cxxflags)); + } + } + break; + case ctor::language::automatic: + case ctor::language::assembler: + // Only c/c++ handled by this task type. + break; + } auto res = execute(settings, compiler(), args, cfg.env); if(res != 0) { |