diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index 6fd8a714695d3bfe737383710568f9cbda404615..1641d0abaaa2000a4bf18370471e4dff3fd30650 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -334,6 +334,7 @@ bool Options::Parse(int argc, const char **argv) } if (opModule.GetValue()) { + mergeAbc_ = opModule.GetValue(); scriptKind_ = es2panda::parser::ScriptKind::MODULE; } else if (opCommonjs.GetValue()) { scriptKind_ = es2panda::parser::ScriptKind::COMMONJS; @@ -375,7 +376,7 @@ bool Options::Parse(int argc, const char **argv) compilerOutput_ = RemoveExtension(util::Helpers::BaseName(sourceFile_)).append(".abc"); } - if (opMergeAbc.GetValue()) { + if (opMergeAbc.GetValue() || mergeAbc_) { recordName_ = recordName.GetValue(); if (recordName_.empty()) { recordName_ = compilerOutput_.empty() ? "Base64Output" : @@ -455,7 +456,7 @@ bool Options::Parse(int argc, const char **argv) compilerOptions_.optLevel = (compilerOptions_.isDebug || !base64Input.GetValue().empty() || base64Output.GetValue()) ? 0 : opOptLevel.GetValue(); compilerOptions_.sourceFiles = sourceFiles_; - compilerOptions_.mergeAbc = opMergeAbc.GetValue(); + compilerOptions_.mergeAbc = opMergeAbc.GetValue() || mergeAbc_; compilerOptions_.patchFixOptions.dumpSymbolTable = opDumpSymbolTable.GetValue(); compilerOptions_.patchFixOptions.symbolTable = opInputSymbolTable.GetValue(); diff --git a/es2panda/aot/options.h b/es2panda/aot/options.h index 00a2b7cf99dababad808859fec6b9f7ede398e16..3c284c83579192e9ad6cca39680b01605d727ac8 100644 --- a/es2panda/aot/options.h +++ b/es2panda/aot/options.h @@ -146,6 +146,7 @@ private: int optLevel_ {0}; int functionThreadCount_ {0}; int fileThreadCount_ {0}; + bool mergeAbc_ {false}; std::string npmModuleEntryList_; std::vector sourceFiles_; std::unordered_map outputFiles_;