diff --git a/src/gcc_wrapper.cpp b/src/gcc_wrapper.cpp index 42127c0..dfd76ff 100644 --- a/src/gcc_wrapper.cpp +++ b/src/gcc_wrapper.cpp @@ -21,13 +21,14 @@ #include "debug_utils.hpp" #include "sys_utils.hpp" +#include "unicode_utils.hpp" #include namespace bcache { namespace { bool is_source_file(const std::string& arg) { - const auto ext = file::get_extension(arg); + const auto ext = lower_case(file::get_extension(arg)); return ((ext == ".cpp") || (ext == ".cc") || (ext == ".cxx") || (ext == ".c")); } @@ -67,7 +68,7 @@ gcc_wrapper_t::gcc_wrapper_t(cache_t& cache) : program_wrapper_t(cache) { bool gcc_wrapper_t::can_handle_command(const std::string& program_exe) { // Is this the right compiler? - const auto cmd = file::get_file_part(program_exe, false); + const auto cmd = lower_case(file::get_file_part(program_exe, false)); return (cmd.find("gcc") != std::string::npos) || (cmd.find("g++") != std::string::npos) || (cmd.find("clang++") != std::string::npos) || (cmd == "clang"); } diff --git a/src/ghs_wrapper.cpp b/src/ghs_wrapper.cpp index 78b5b54..732b845 100644 --- a/src/ghs_wrapper.cpp +++ b/src/ghs_wrapper.cpp @@ -20,7 +20,7 @@ #include "ghs_wrapper.hpp" #include "file_utils.hpp" -#include "hasher.hpp" +#include "unicode_utils.hpp" #include @@ -30,7 +30,7 @@ ghs_wrapper_t::ghs_wrapper_t(cache_t& cache) : gcc_wrapper_t(cache) { bool ghs_wrapper_t::can_handle_command(const std::string& program_exe) { // Is this the right compiler? - const auto cmd = file::get_file_part(program_exe, false); + const auto cmd = lower_case(file::get_file_part(program_exe, false)); return (cmd.find("ccarm") != std::string::npos) || (cmd.find("cxarm") != std::string::npos) || (cmd.find("ccthumb") != std::string::npos) || (cmd.find("cxthumb") != std::string::npos) || (cmd.find("ccintarm") != std::string::npos) || (cmd.find("cxintarm") != std::string::npos); diff --git a/src/main.cpp b/src/main.cpp index 646f0e8..e8efa9f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ #include "program_wrapper.hpp" #include "string_list.hpp" #include "sys_utils.hpp" +#include "unicode_utils.hpp" #include #include @@ -58,7 +59,7 @@ bcache::string_list_t get_lua_paths(const bcache::cache_t& cache) { } bool is_lua_script(const std::string& script_path) { - return (bcache::file::get_extension(script_path) == ".lua"); + return (bcache::lower_case(bcache::file::get_extension(script_path)) == ".lua"); } [[noreturn]] void clear_cache_and_exit() { diff --git a/src/msvc_wrapper.cpp b/src/msvc_wrapper.cpp index b9373f3..20b8185 100644 --- a/src/msvc_wrapper.cpp +++ b/src/msvc_wrapper.cpp @@ -21,13 +21,14 @@ #include "debug_utils.hpp" #include "sys_utils.hpp" +#include "unicode_utils.hpp" #include namespace bcache { namespace { bool is_source_file(const std::string& arg) { - const auto ext = file::get_extension(arg); + const auto ext = lower_case(file::get_extension(arg)); return ((ext == ".cpp") || (ext == ".cc") || (ext == ".cxx") || (ext == ".c")); } @@ -73,7 +74,7 @@ msvc_wrapper_t::msvc_wrapper_t(cache_t& cache) : program_wrapper_t(cache) { bool msvc_wrapper_t::can_handle_command(const std::string& program_exe) { // Is this the right compiler? - const auto cmd = file::get_file_part(program_exe, false); + const auto cmd = lower_case(file::get_file_part(program_exe, false)); return (cmd == "cl"); }