From b45de517c42b550cc9009eb68fb8e2dc3e6a912b Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 5 Mar 2021 12:51:23 +0300 Subject: [PATCH] Native stdlib build: fix using OptionalExpectation in Interop/Runtime Current build for kotlin-native/Interop/Runtime sources is not truly MPP, so explicit -Xcommon-sources flags are required for the compiler to allow using OptionalExpectation annotations. --- kotlin-native/backend.native/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index c5a0f28793c..ec2780554dd 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -215,8 +215,10 @@ task stdlib(dependsOn: "${hostName}Stdlib") def commonSrc = project(":kotlin-stdlib-common").files("src/kotlin", "src/generated", "../unsigned/src", "../src").files +def interopRuntimeCommonSrc = project(':kotlin-native:Interop:Runtime').file('src/main/kotlin') + final List stdLibSrc = [ - project(':kotlin-native:Interop:Runtime').file('src/main/kotlin'), + interopRuntimeCommonSrc, project(':kotlin-native:Interop:Runtime').file('src/native/kotlin'), project(':kotlin-native:Interop:JsRuntime').file('src/main/kotlin'), project(':kotlin-native:runtime').file('src/main/kotlin') @@ -260,6 +262,7 @@ targetList.each { target -> "-Xcommon-sources=${commonSrc.join(',')}", "-Xcommon-sources=${testAnnotationCommon.join(',')}", "-Xcommon-sources=${testCommon.join(',')}", + "-Xcommon-sources=$interopRuntimeCommonSrc", *stdLibSrc] stdLibSrc.forEach { inputs.dir(it) } commonSrc.forEach{