aboutsummaryrefslogtreecommitdiff
path: root/backend/BackendUtils.hpp
blob: d53620c1a6faf30d0e071a2cbdea86a6b45f890b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "../include/Conf.hpp"

namespace backend
{
    class Ninja;

    enum class RuntimeCompilerType
    {
        NONE,
        OTHER,
        CLANG,
        EMSCRIPTEN
    };
    
    class BackendUtils
    {
    public:
        static sibs::FileString getFileExtension(const sibs::FileString &filepath);
        static sibs::Language getFileLanguage(const _tinydir_char_t *extension);
        static sibs::Language getFileLanguage(tinydir_file *file);
        static void collectSourceFiles(const _tinydir_char_t *projectPath, Ninja *ninjaProject, const sibs::SibsConfig &sibsConfig, bool recursive = true);
        static std::string getCompilerCExecutable(sibs::Compiler compiler);
        static std::string getCompilerCppExecutable(sibs::Compiler compiler);
        static std::string getCompilerLinker(sibs::Compiler compiler);
        static RuntimeCompilerType getCCompilerType(sibs::Compiler compiler);
        static RuntimeCompilerType getCppCompilerType(sibs::Compiler compiler);
    };
}