[JS IR BE] Support main function
* Implement IR-based main function detector
This commit is contained in:
@@ -198,7 +198,8 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
return ExitCode.COMPILATION_ERROR
|
||||
}
|
||||
|
||||
// TODO: Handle main call parameters
|
||||
// TODO: Handle non-empty main call arguments
|
||||
val mainCallArguments = if (K2JsArgumentConstants.NO_CALL == arguments.main) null else emptyList<String>()
|
||||
|
||||
val dependencies = libraries.flatMap { listOfNotNull(loadIrLibrary(it, messageCollector)) }
|
||||
.distinctBy { it.moduleName }
|
||||
@@ -214,7 +215,8 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
sourcesFiles,
|
||||
configuration,
|
||||
immediateDependencies = dependencies,
|
||||
allDependencies = dependencies
|
||||
allDependencies = dependencies,
|
||||
mainArguments = mainCallArguments
|
||||
)
|
||||
|
||||
outputFile.writeText(compiledModule)
|
||||
|
||||
Reference in New Issue
Block a user