// -*- c++ -*- // Distributed under the BSD 2-Clause License. // See accompanying file LICENSE for details. #pragma once #include #include #include "libctor.h" enum class ToolChain { gcc, clang, }; enum class opt { // gcc/clang output, // -o debug, // -g strip, // -s warn_all, // -Wall warnings_as_errors, // -Werror generate_dep_tree, // -MMD no_link, // -c include_path, // -I library_path, // -L link, // -l cpp_std, // -std= build_shared, // -shared threads, // -pthread optimization, // -O position_independent_code, // -fPIC position_independent_executable, // -fPIE custom, // entire option taken verbatim from }; //! Get tool-chain type from output system (via configuration) ToolChain getToolChain(OutputSystem system); //! Get tool argument(s) for specific option type matching the supplied //! tool-chain std::vector getOption(ToolChain tool_chain, 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 getOption(const std::string& flag, ToolChain tool_chain = ToolChain::gcc);