Auto link everything found in dist/klib.

Disable such behavior with -nodefaultlibs.
Omit libraries from the link stage if their packages have not been referenced.
This commit is contained in:
Alexander Gorshenev
2017-09-15 15:42:54 +03:00
committed by alexander-gorshenev
parent 5d79c079b4
commit 27f7e4263b
10 changed files with 79 additions and 20 deletions
@@ -78,6 +78,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
with(KonanConfigKeys) {
with(configuration) {
put(NODEFAULTLIBS, arguments.nodefaultlibs)
put(NOSTDLIB, arguments.nostdlib)
put(NOPACK, arguments.nopack)
put(NOMAIN, arguments.nomain)
@@ -48,6 +48,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-nativelibrary", shortName = "-nl", valueDescription = "<path>", description = "Include the native bitcode library")
var nativeLibraries: Array<String>? = null
@Argument(value = "-nodefaultlibs", description = "Don't link the libraries from dist/klib automatically")
var nodefaultlibs: Boolean = false
@Argument(value = "-nomain", description = "Assume 'main' entry point to be provided by external libraries")
var nomain: Boolean = false