From a477233b048c90b6f2d05bd7fa5bac6e2befcddd Mon Sep 17 00:00:00 2001 From: LepilkinaElena Date: Tue, 25 Feb 2020 18:16:55 +0300 Subject: [PATCH] =?UTF-8?q?Added=20option=20to=20add=20compiler=20options?= =?UTF-8?q?=20for=20kotlinc=20compiler=20call=20in=20cin=E2=80=A6=20(#3906?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt | 2 ++ .../org/jetbrains/kotlin/cli/utilities/InteropCompiler.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt index dd59c807af0..72d37ea3045 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/CommandLine.kt @@ -61,6 +61,8 @@ open class CommonInteropArguments(val argParser: ArgParser) { description = "don't link unused libraries even explicitly specified").default(false) val tempDir by argParser.option(ArgType.String, TEMP_DIR, description = "save temporary files to the given directory") + val kotlincOption by argParser.option(ArgType.String, "Xkotlinc-option", + description = "additional kotlinc compiler option").multiple() companion object { const val MODE_SOURCECODE = "sourcecode" diff --git a/utilities/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/InteropCompiler.kt b/utilities/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/InteropCompiler.kt index 94112b867ac..2b620de6dff 100644 --- a/utilities/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/InteropCompiler.kt +++ b/utilities/src/main/kotlin/org/jetbrains/kotlin/cli/utilities/InteropCompiler.kt @@ -67,7 +67,8 @@ fun invokeInterop(flavor: String, args: Array): Array? { repos.flatMap { listOf("-repo", it) } + (if (noDefaultLibs) arrayOf("-$NODEFAULTLIBS") else emptyArray()) + (if (noEndorsedLibs) arrayOf("-$NOENDORSEDLIBS") else emptyArray()) + - (if (purgeUserLibs) arrayOf("-$PURGE_USER_LIBS") else emptyArray()) + (if (purgeUserLibs) arrayOf("-$PURGE_USER_LIBS") else emptyArray()) + + arguments.kotlincOption }