diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-12 15:49:16 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-12 15:59:22 +0100 |
commit | c093758b4688fb5bae2cc7727b6c9b52b824043e (patch) | |
tree | f92c206b0fa6366319e17f1c7f375dfeb0ab5f27 /src/tools.cc | |
parent | cc4e14d243f4e7e1ad487d8865c5ffc8423e473d (diff) |
Move tools opt to ctor.h and rename tool_chain to toolchain for consistency.
Diffstat (limited to 'src/tools.cc')
-rw-r--r-- | src/tools.cc | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/tools.cc b/src/tools.cc index ddb1463..610a550 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -50,43 +50,43 @@ ctor::toolchain getToolChain(ctor::output_system system) namespace { -std::vector<std::string> getOptionGcc(opt option, const std::string& arg) +std::vector<std::string> getOptionGcc(ctor::opt option, const std::string& arg) { switch(option) { - case opt::output: + case ctor::opt::output: return {"-o", arg}; - case opt::debug: + case ctor::opt::debug: return {"-g"}; - case opt::strip: + case ctor::opt::strip: return {"-s"}; - case opt::warn_all: + case ctor::opt::warn_all: return {"-Wall"}; - case opt::warnings_as_errors: + case ctor::opt::warnings_as_errors: return {"-Werror"}; - case opt::generate_dep_tree: + case ctor::opt::generate_dep_tree: return {"-MMD"}; - case opt::no_link: + case ctor::opt::no_link: return {"-c"}; - case opt::include_path: + case ctor::opt::include_path: return {"-I" + arg}; - case opt::library_path: + case ctor::opt::library_path: return {"-L" + arg}; - case opt::link: + case ctor::opt::link: return {"-l" + arg}; - case opt::cpp_std: + case ctor::opt::cpp_std: return {"-std=" + arg}; - case opt::build_shared: + case ctor::opt::build_shared: return {"-shared"}; - case opt::threads: + case ctor::opt::threads: return {"-pthread"}; - case opt::optimization: + case ctor::opt::optimization: return {"-O" + arg}; - case opt::position_independent_code: + case ctor::opt::position_independent_code: return {"-fPIC"}; - case opt::position_independent_executable: + case ctor::opt::position_independent_executable: return {"-fPIE"}; - case opt::custom: + case ctor::opt::custom: return {arg}; } @@ -96,7 +96,7 @@ std::vector<std::string> getOptionGcc(opt option, const std::string& arg) } std::vector<std::string> getOption(ctor::toolchain toolchain, - opt option, + ctor::opt option, const std::string& arg) { switch(toolchain) @@ -114,28 +114,28 @@ std::vector<std::string> getOption(ctor::toolchain toolchain, } namespace { -std::pair<opt, std::string> getOptionGcc(const std::string& flag) +std::pair<ctor::opt, std::string> getOptionGcc(const std::string& flag) { if(flag.substr(0, 2) == "-I") { std::string path = flag.substr(2); path.erase(0, path.find_first_not_of(' ')); - return { opt::include_path, path }; + return { ctor::opt::include_path, path }; } if(flag.substr(0, 2) == "-L") { std::string path = flag.substr(2); path.erase(0, path.find_first_not_of(' ')); - return { opt::library_path, path }; + return { ctor::opt::library_path, path }; } - return { opt::custom, flag }; + return { ctor::opt::custom, flag }; } } -std::pair<opt, std::string> getOption(const std::string& flag, - ctor::toolchain toolchain) +std::pair<ctor::opt, std::string> getOption(const std::string& flag, + ctor::toolchain toolchain) { switch(toolchain) { @@ -148,5 +148,5 @@ std::pair<opt, std::string> getOption(const std::string& flag, } std::cerr << "Unsupported tool-chain.\n"; - return { opt::custom, flag }; + return { ctor::opt::custom, flag }; } |