mirror of
https://github.com/encounter/buildcache.git
synced 2026-07-09 18:18:50 -07:00
Use lower_case for relevant string comparisons
This commit is contained in:
+3
-2
@@ -21,13 +21,14 @@
|
||||
|
||||
#include "debug_utils.hpp"
|
||||
#include "sys_utils.hpp"
|
||||
#include "unicode_utils.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@
|
||||
#include "ghs_wrapper.hpp"
|
||||
|
||||
#include "file_utils.hpp"
|
||||
#include "hasher.hpp"
|
||||
#include "unicode_utils.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -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);
|
||||
|
||||
+2
-1
@@ -26,6 +26,7 @@
|
||||
#include "program_wrapper.hpp"
|
||||
#include "string_list.hpp"
|
||||
#include "sys_utils.hpp"
|
||||
#include "unicode_utils.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
@@ -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() {
|
||||
|
||||
@@ -21,13 +21,14 @@
|
||||
|
||||
#include "debug_utils.hpp"
|
||||
#include "sys_utils.hpp"
|
||||
#include "unicode_utils.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user