MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
HostEnvironment.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace MayaFlux::Platform {
4
5#ifdef MAYAFLUX_PLATFORM_WINDOWS
6constexpr char PathSeparator = '\\';
7#else
8constexpr char PathSeparator = '/';
9#endif
10
11std::string safe_getenv(const char* var);
12
13namespace fs = std::filesystem;
14class MAYAFLUX_API SystemConfig {
15public:
16
17 enum class LibraryType : uint8_t {
18 Static,
19 Shared
20 };
21
22 static const std::string& get_clang_resource_dir();
23
24 static const std::vector<std::string>& get_system_includes();
25
26 static const std::vector<std::string>& get_system_libraries();
27
28 static const std::string& find_dep_library(const std::string& library_name, const std::string& prefix = "");
29
30 static const std::string& get_dep_includes(const std::string& library_name);
31
32#ifdef MAYAFLUX_PLATFORM_MACOS
33 static std::string get_macos_sdk_path();
34#endif // MAYAFLUX_PLATFORM_MACOS
35
36 static std::string exec_command(const char* cmd);
37
38 static void trim_output(std::string& str);
39
40private:
41 static std::string format_library_name(const std::string& library_name, LibraryType type = LibraryType::Static);
42
43 static std::vector<std::string> get_clang_includes();
44
45 static std::vector<std::string> parse_clang_search_paths(const std::string& output);
46
47 static std::string find_latest_sdk_version(const fs::path& base);
48
49#ifdef MAYAFLUX_PLATFORM_WINDOWS
50
51 static std::string find_latest_vs_installation();
52
53 static std::string find_latest_msvc_version(const fs::path& msvc_base);
54
55 static std::vector<std::string> get_msvc_includes();
56
57 static std::vector<std::string> get_msvc_libraries();
58
59 static std::vector<std::string> get_windows_sdk_includes();
60
61 static std::vector<std::string> get_windows_sdk_libraries();
62
63 static std::vector<std::string> probe_sdk_paths(const std::string& subpath,
64 const std::vector<std::string>& subdirs,
65 const std::string& arch = "");
66
67#else
68 static std::vector<std::string> get_unix_library_paths();
69#ifdef MAYAFLUX_PLATFORM_MACOS
70 static std::string get_xcode_system_includes();
71#endif // MAYAFLUX_PLATFORM_MACOS
72
73#endif // MAYAFLUX_PLATFORM_WINDOWS
74};
75
76} // namespace Platform
vk::CommandBuffer cmd
std::string safe_getenv(const char *var)
constexpr char PathSeparator