diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-16 17:51:57 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-16 17:51:57 +0100 |
commit | 9da7f08eb0f34f52561a62d7cf1004621b7d83c2 (patch) | |
tree | 012a9620b5a52f7a1098d04a1cb6c45404e41e1b /src/util.cc | |
parent | a257c2f4d333969c73d8b27124e658db6430645a (diff) |
Make file extensions abstract based on tool-chain type.
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 38 |
1 files changed, 0 insertions, 38 deletions
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 <iostream> #include <fstream> #include <algorithm> -#include <cctype> 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; |