summaryrefslogtreecommitdiff
path: root/src/tools.h
blob: e6c22641380596baab9e4e0a5be931c2e40065c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// -*- c++ -*-
// Distributed under the BSD 2-Clause License.
// See accompanying file LICENSE for details.
#pragma once

#include <vector>
#include <string>

#include "ctor.h"

//! Get tool-chain type from compiler path string
ctor::toolchain getToolChain(const std::string& compiler);

//! Get tool-chain type from output system (via configuration)
ctor::toolchain getToolChain(ctor::output_system system);

//! Get tool argument(s) for specific option type matching the supplied
//! tool-chain
std::vector<std::string> getOption(ctor::toolchain toolchain,
                                   ctor::opt option,
                                   const std::string& arg = {});

//! Get opt enum value and argument from string,
//! ie. { opt::InludePath, "foo/bar" } from "-Ifoo/bar"
//! Returns { opt::Custom, flag } if unknown.
std::pair<ctor::opt, std::string> getOption(const std::string& flag,
                                            ctor::toolchain toolchain = ctor::toolchain::gcc);