MayaFlux 0.2.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
11static std::string safe_getenv(const char* var);
12
13namespace fs = std::filesystem;
14class MAYAFLUX_API SystemConfig {
15public:
16 static const std::string& get_clang_resource_dir();
17
18 static const std::vector<std::string>& get_system_includes();
19
20 static const std::vector<std::string>& get_system_libraries();
21
22 static const std::string& find_library(const std::string& library_name);
23
24 static const std::string& get_dep_includes(const std::string& library_name);
25
26#ifdef MAYAFLUX_PLATFORM_MACOS
27 static std::string get_macos_sdk_path();
28#endif // MAYAFLUX_PLATFORM_MACOS
29
30private:
31 static std::string exec_command(const char* cmd);
32
33 static void trim_output(std::string& str);
34
35 static std::string format_library_name(const std::string& library_name);
36
37 static std::vector<std::string> get_clang_includes();
38
39 static std::vector<std::string> parse_clang_search_paths(const std::string& output);
40
41 static std::string find_latest_sdk_version(const fs::path& base);
42
43#ifdef MAYAFLUX_PLATFORM_WINDOWS
44
45 static std::string find_latest_vs_installation();
46
47 static std::string find_latest_msvc_version(const fs::path& msvc_base);
48
49 static std::vector<std::string> get_msvc_includes();
50
51 static std::vector<std::string> get_msvc_libraries();
52
53 static std::vector<std::string> get_windows_sdk_includes();
54
55 static std::vector<std::string> get_windows_sdk_libraries();
56
57 static std::vector<std::string> probe_sdk_paths(const std::string& subpath,
58 const std::vector<std::string>& subdirs,
59 const std::string& arch = "");
60
61#else
62 static std::vector<std::string> get_unix_library_paths();
63#ifdef MAYAFLUX_PLATFORM_MACOS
64 static std::string get_xcode_system_includes();
65#endif // MAYAFLUX_PLATFORM_MACOS
66
67#endif // MAYAFLUX_PLATFORM_WINDOWS
68};
69
70} // namespace Platform
std::string safe_getenv(const char *var)
constexpr char PathSeparator