9 #include "flutter/fml/logging.h"
17 : assets_path_(properties.assets_path),
18 icu_path_(properties.icu_data_path) {
28 dart_entrypoint_arguments_.push_back(
33 if (assets_path_.is_relative() || icu_path_.is_relative() ||
34 (!aot_library_path_.empty() && aot_library_path_.is_relative())) {
36 if (executable_location.empty()) {
38 <<
"Unable to find executable location to resolve resource paths.";
39 assets_path_ = std::filesystem::path();
40 icu_path_ = std::filesystem::path();
42 assets_path_ = std::filesystem::path(executable_location) / assets_path_;
43 icu_path_ = std::filesystem::path(executable_location) / icu_path_;
44 if (!aot_library_path_.empty()) {
46 std::filesystem::path(executable_location) / aot_library_path_;
53 return !assets_path_.empty() && !icu_path_.empty();
59 const FlutterEngineProcTable& engine_procs) {
60 if (aot_library_path_.empty()) {
62 <<
"Attempted to load AOT data, but no aot_library_path was provided.";
65 if (!std::filesystem::exists(aot_library_path_)) {
66 FML_LOG(ERROR) <<
"Can't load AOT data from "
67 << aot_library_path_.u8string() <<
"; no such file.";
70 std::string path_string = aot_library_path_.u8string();
71 FlutterEngineAOTDataSource source = {};
72 source.type = kFlutterEngineAOTDataSourceTypeElfPath;
73 source.elf_path = path_string.c_str();
74 FlutterEngineAOTData data =
nullptr;
75 auto result = engine_procs.CreateAOTData(&source, &data);
76 if (result != kSuccess) {
77 FML_LOG(ERROR) <<
"Failed to load AOT data from: " << path_string;
86 const std::vector<std::string>& switches) {
87 engine_switches_ = switches;
91 if (engine_switches_.size() == 0) {
94 std::vector<std::string> switches;
95 switches.insert(switches.end(), engine_switches_.begin(),
96 engine_switches_.end());
99 switches.insert(switches.end(), env_switches.begin(), env_switches.end());