Allow including external binaries within klibs with -includeBinary flag.

Link such binaries in case they are javascripts on wasm32.
Otherwise don't do anything useful yet.
This commit is contained in:
Alexander Gorshenev
2017-09-08 14:34:56 +03:00
committed by alexander-gorshenev
parent c363732eb5
commit e9720b7e13
12 changed files with 54 additions and 3 deletions
@@ -87,6 +87,8 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
arguments.target ?.let{ put(TARGET, it) }
put(INCLUDED_BINARY_FILES,
arguments.includeBinaries.toNonNullList())
put(NATIVE_LIBRARY_FILES,
arguments.nativeLibraries.toNonNullList())
put(REPOSITORIES,
@@ -30,6 +30,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-enable_assertions", shortName = "-ea", description = "Enable runtime assertions in generated code")
var enableAssertions: Boolean = false
@Argument(value = "-includeBinary", shortName = "-ib", valueDescription = "<path>", description = "Pack external binary within the klib")
var includeBinaries: Array<String>? = null
@Argument(value = "-library", shortName = "-l", valueDescription = "<path>", description = "Link with the library")
var libraries: Array<String>? = null
@@ -39,7 +42,7 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-manifest", valueDescription = "<path>", description = "Provide a maniferst addend file")
var manifestFile: String? = null
@Argument(value = "-nativelibrary", shortName = "-nl", valueDescription = "<path>", description = "Include the native library")
@Argument(value = "-nativelibrary", shortName = "-nl", valueDescription = "<path>", description = "Include the native bitcode library")
var nativeLibraries: Array<String>? = null
@Argument(value = "-nomain", description = "Assume 'main' entry point to be provided by external libraries")