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.
This commit is contained in:
Svyatoslav Scherbina
2021-03-05 12:51:23 +03:00
committed by Space
parent 03df752e8e
commit b45de517c4
+4 -1
View File
@@ -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<File> 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{