Toolchain Utils#
Commonly used Utils (Classes / Structs) for Toolchain
file_ext.h#
toolchain_config.h#
-
struct ToolchainConfig#
Public Functions
-
ToolchainConfig() = default#
-
FileExt GetFileExt(const fs::path &filepath) const#
Get the valid file extension from a path.
See ToolchainConfig::valid_c_ext, ToolchainConfig::valid_cpp_ext, ToolchainConfig::valid_asm_ext, ToolchainConfig::valid_header_ext
- Parameters
filepath – Absolute / Relative path of the file
- Returns
FileExt File path detected as per Toolchain::valid_* variables
-
bool IsValidSource(const fs::path &filepath) const#
Checks for C/C++ source file validity.
See ToolchainConfig::valid_c_ext, ToolchainConfig::valid_cpp_ext, ToolchainConfig::valid_asm_ext
- Parameters
filepath – Absolute / Relative path of file
- Returns
true If file extension belongs to the above valid_* list
- Returns
false If file extension does not belong to the above valid_* list
-
bool IsValidHeader(const fs::path &filepath) const#
Checks for Header file validity.
See ToolchainConfig::valid_header_ext
- Parameters
filepath – Absolute / Relative path of file
- Returns
true If file extension belongs to above valid_* list
- Returns
false If file extension does not belong to above valid_* list
-
void ExpectsValidSource(const fs::path &filepath) const#
Expects Source file validity.
env::assert_fatal if not a valid source
- Parameters
filepath – Absolute / Relative path of file
-
void ExpectsValidHeader(const fs::path &filepath) const#
Expects header file validity.
env::assert_fatal if not a valid header
- Parameters
filepath – Absolute / Relative path of file
Public Members
-
std::string obj_ext = {".o"}#
-
std::string pch_header_ext = {".h"}#
-
std::string pch_compile_ext = {".gch"}#
-
std::string prefix_include_dir = {"-I"}#
-
std::string prefix_lib_dir = {"-L"}#
-
std::unordered_set<std::string> valid_c_ext = {".c"}#
-
std::unordered_set<std::string> valid_cpp_ext = {".cpp", ".cxx", ".cc"}#
-
std::unordered_set<std::string> valid_asm_ext = {".s", ".S", ".asm"}#
-
std::unordered_set<std::string> valid_header_ext = {".h", ".hpp"}#
-
ToolchainConfig() = default#