9 #include "flutter/fml/logging.h"
10 #include "flutter/fml/string_conversion.h"
18 : assets_path_(properties.assets_path),
19 icu_path_(properties.icu_data_path) {
29 dart_entrypoint_arguments_.push_back(
48 if (assets_path_.is_relative() || icu_path_.is_relative() ||
49 (!aot_library_path_.empty() && aot_library_path_.is_relative())) {
51 if (executable_location.empty()) {
53 <<
"Unable to find executable location to resolve resource paths.";
54 assets_path_ = std::filesystem::path();
55 icu_path_ = std::filesystem::path();
57 assets_path_ = std::filesystem::path(executable_location) / assets_path_;
58 icu_path_ = std::filesystem::path(executable_location) / icu_path_;
59 if (!aot_library_path_.empty()) {
61 std::filesystem::path(executable_location) / aot_library_path_;
68 return !assets_path_.empty() && !icu_path_.empty();
74 const FlutterEngineProcTable& engine_procs) {
75 if (aot_library_path_.empty()) {
77 <<
"Attempted to load AOT data, but no aot_library_path was provided.";
80 if (!std::filesystem::exists(aot_library_path_)) {
81 FML_LOG(ERROR) <<
"Can't load AOT data from " << aot_library_path_
85 std::string path_string = fml::PathToUtf8(aot_library_path_);
86 FlutterEngineAOTDataSource source = {};
87 source.type = kFlutterEngineAOTDataSourceTypeElfPath;
88 source.elf_path = path_string.c_str();
89 FlutterEngineAOTData data =
nullptr;
90 auto result = engine_procs.CreateAOTData(&source, &data);
91 if (result != kSuccess) {
92 FML_LOG(ERROR) <<
"Failed to load AOT data from: " << path_string;
101 const std::vector<std::string>& switches) {
102 engine_switches_ = switches;
106 if (engine_switches_.size() == 0) {
109 std::vector<std::string> switches;
110 switches.insert(switches.end(), engine_switches_.begin(),
111 engine_switches_.end());
114 switches.insert(switches.end(), env_switches.begin(), env_switches.end());
const std::vector< std::string > GetSwitches()
FlutterProjectBundle(const FlutterDesktopEngineProperties &properties)
UniqueAotDataPtr LoadAotData(const FlutterEngineProcTable &engine_procs)
void SetSwitches(const std::vector< std::string > &switches)
std::vector< std::string > GetSwitchesFromEnvironment()
std::filesystem::path GetExecutableDirectory()
std::unique_ptr< _FlutterEngineAOTData, FlutterEngineCollectAOTDataFnPtr > UniqueAotDataPtr
const char * dart_entrypoint
FlutterDesktopAccessibilityMode accessibility_mode
FlutterDesktopImpellerSwitch impeller_switch
const char ** dart_entrypoint_argv
FlutterDesktopUIThreadPolicy ui_thread_policy
const wchar_t * aot_library_path
FlutterDesktopGpuPreference gpu_preference