From 9da7f08eb0f34f52561a62d7cf1004621b7d83c2 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 16 Jan 2023 17:51:57 +0100 Subject: Make file extensions abstract based on tool-chain type. --- src/util.cc | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src/util.cc') diff --git a/src/util.cc b/src/util.cc index 08a135f..fe16471 100644 --- a/src/util.cc +++ b/src/util.cc @@ -6,7 +6,6 @@ #include #include #include -#include std::string to_lower(const std::string& str) { @@ -152,43 +151,6 @@ std::string cleanUp(const std::string& path) return cleaned; } -ctor::target_type target_type_from_extension(const std::filesystem::path& file) -{ - auto ext = to_lower(file.extension().string()); - // Loosely based on: - // https://en.wikipedia.org/wiki/List_of_file_formats#Object_code,_executable_files,_shared_and_dynamically_linked_libraries - if(ext == ".a" || - ext == ".lib") - { - return ctor::target_type::static_library; - } - - if(ext == ".so" || - ext == ".dll" || - ext == ".dylib") - { - return ctor::target_type::dynamic_library; - } - - if(ext == ".o" || - ext == ".obj") - { - return ctor::target_type::object; - } - - if(ext == "" || - ext == ".exe" || - ext == ".com" || - ext == ".bin" || - ext == ".run" || - ext == ".out") - { - return ctor::target_type::executable; - } - - return ctor::target_type::unknown; -} - std::string esc(const std::string& in) { std::string out; -- cgit v1.2.3