Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,42 +235,42 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir),
&settings.assets_path);

std::string aot_shared_library_name;
command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryName),
&aot_shared_library_name);
std::string aot_shared_library_path;
command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath),
&aot_shared_library_path);

std::string snapshot_asset_path;
command_line.GetOptionValue(FlagForSwitch(Switch::SnapshotAssetPath),
&snapshot_asset_path);
std::string aot_snapshot_path;
command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath),
&aot_snapshot_path);

std::string vm_snapshot_data_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotData),
&vm_snapshot_data_filename);
std::string aot_vm_snapshot_data_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData),
&aot_vm_snapshot_data_filename);

std::string vm_snapshot_instr_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotInstructions),
&vm_snapshot_instr_filename);
std::string aot_vm_snapshot_instr_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions),
&aot_vm_snapshot_instr_filename);

std::string isolate_snapshot_data_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::IsolateSnapshotData),
&isolate_snapshot_data_filename);
std::string aot_isolate_snapshot_data_filename;
command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData),
&aot_isolate_snapshot_data_filename);

std::string isolate_snapshot_instr_filename;
std::string aot_isolate_snapshot_instr_filename;
command_line.GetOptionValue(
FlagForSwitch(Switch::IsolateSnapshotInstructions),
&isolate_snapshot_instr_filename);

if (aot_shared_library_name.size() > 0) {
settings.application_library_path = aot_shared_library_name;
} else if (snapshot_asset_path.size() > 0) {
settings.vm_snapshot_data_path =
fml::paths::JoinPaths({snapshot_asset_path, vm_snapshot_data_filename});
FlagForSwitch(Switch::AotIsolateSnapshotInstructions),
&aot_isolate_snapshot_instr_filename);

if (aot_shared_library_path.size() > 0) {
settings.application_library_path = aot_shared_library_path;
} else if (aot_snapshot_path.size() > 0) {
settings.vm_snapshot_data_path = fml::paths::JoinPaths(
{aot_snapshot_path, aot_vm_snapshot_data_filename});
settings.vm_snapshot_instr_path = fml::paths::JoinPaths(
{snapshot_asset_path, vm_snapshot_instr_filename});
{aot_snapshot_path, aot_vm_snapshot_instr_filename});
settings.isolate_snapshot_data_path = fml::paths::JoinPaths(
{snapshot_asset_path, isolate_snapshot_data_filename});
{aot_snapshot_path, aot_isolate_snapshot_data_filename});
settings.isolate_snapshot_instr_path = fml::paths::JoinPaths(
{snapshot_asset_path, isolate_snapshot_instr_filename});
{aot_snapshot_path, aot_isolate_snapshot_instr_filename});
}

command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath),
Expand Down
28 changes: 13 additions & 15 deletions shell/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,28 @@ namespace flutter {
// clang-format on

DEF_SWITCHES_START
DEF_SWITCH(AotSharedLibraryName,
"aot-shared-library-name",
"Name of the *.so containing AOT compiled Dart assets.")
DEF_SWITCH(SnapshotAssetPath,
"snapshot-asset-path",
DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.")
DEF_SWITCH(AotSnapshotPath,
"aot-snapshot-path",
"Path to the directory containing the four files specified by "
"VmSnapshotData, VmSnapshotInstructions, "
"VmSnapshotInstructions and IsolateSnapshotInstructions.")
DEF_SWITCH(VmSnapshotData,
"AotVmSnapshotData, AotVmSnapshotInstructions, "
"AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.")
DEF_SWITCH(AotVmSnapshotData,
"vm-snapshot-data",
"The VM snapshot data that will be memory mapped as read-only. "
"SnapshotAssetPath must be present.")
DEF_SWITCH(VmSnapshotInstructions,
"AotSnapshotPath must be present.")
DEF_SWITCH(AotVmSnapshotInstructions,
"vm-snapshot-instr",
"The VM instructions snapshot that will be memory mapped as read "
"and executable. SnapshotAssetPath must be present.")
DEF_SWITCH(IsolateSnapshotData,
"and executable. AotSnapshotPath must be present.")
DEF_SWITCH(AotIsolateSnapshotData,
"isolate-snapshot-data",
"The isolate snapshot data that will be memory mapped as read-only. "
"SnapshotAssetPath must be present.")
DEF_SWITCH(IsolateSnapshotInstructions,
"AotSnapshotPath must be present.")
DEF_SWITCH(AotIsolateSnapshotInstructions,
"isolate-snapshot-instr",
"The isolate instructions snapshot that will be memory mapped as "
"read and executable. SnapshotAssetPath must be present.")
"read and executable. AotSnapshotPath must be present.")
DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.")
DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.")
DEF_SWITCH(ICUSymbolPrefix,
Expand Down
Loading