From e22d9821e2433bba721f1dad4836944c7ee1b9ac Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Wed, 4 Oct 2023 18:22:02 +0200 Subject: [PATCH] Native: fix kotlin-native/performance/framework build script for K2 The build script manually specifies which directories are parts of which source sets. And it did that wrong: all directories were just added to the nativeMain source set. This was an incorrect configuration (matching expect and actual were getting into the same source set), and K2 compiler was not really happy with that. This commit fixes the correspondence between source sets and source directories in kotlin-native/performance/framework build script, thus fixes the build for that benchmark with K2. --- kotlin-native/performance/framework/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kotlin-native/performance/framework/build.gradle b/kotlin-native/performance/framework/build.gradle index f0b85e6063b..ee1db413f14 100644 --- a/kotlin-native/performance/framework/build.gradle +++ b/kotlin-native/performance/framework/build.gradle @@ -20,10 +20,13 @@ def archSuffix = PlatformInfo.hostName.substring(PlatformInfo.hostName.lastIndex kotlin { sourceSets { - nativeMain { + commonMain { kotlin.srcDir "$toolsPath/benchmarks/shared/src" kotlin.srcDir "$toolsPath/benchmarksAnalyzer/src/main/kotlin" kotlin.srcDir "$rootProject.projectDir/../endorsedLibraries/kotlinx.cli/src/main/kotlin" + } + nativeMain { + dependsOn commonMain kotlin.srcDir "$rootProject.projectDir/../endorsedLibraries/kotlinx.cli/src/main/kotlin-native" kotlin.srcDir "$toolsPath/benchmarksAnalyzer/src/main/kotlin-native" }