diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIncrementalCompilationIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIncrementalCompilationIT.kt index 2d9ee04af4570..486ac9e2b71f4 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIncrementalCompilationIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativeIncrementalCompilationIT.kt @@ -40,9 +40,10 @@ class NativeIncrementalCompilationIT : KGPBaseTest() { "-Xbackend-threads=4" ) + val icCacheDir = projectPath.resolve("build").resolve("kotlin-native-ic-cache").resolve("debugExecutable") val incrementalCacheArgs = arrayOf( "-Xenable-incremental-compilation", - "-Xic-cache-dir=${projectPath.resolve("build").resolve("kotlin-native-ic-cache").toFile().canonicalPath}" + "-Xic-cache-dir=${icCacheDir.toFile().canonicalPath}" ) val withoutIncrementalCacheBuildOptions = defaultBuildOptions.copy( diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeLink.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeLink.kt index 22fe6b66494d4..90321a853c5c8 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeLink.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeLink.kt @@ -379,7 +379,9 @@ constructor( add("-Xauto-cache-from=${cacheSettings.gradleUserHomeDir}") add("-Xbackend-threads=${cacheSettings.threads}") if (cacheSettings.icEnabled) { - val icCacheDir = cacheSettings.gradleBuildDir.resolve("kotlin-native-ic-cache") + val icCacheDir = cacheSettings.gradleBuildDir + .resolve("kotlin-native-ic-cache") + .resolve(binaryName) icCacheDir.mkdirs() add("-Xenable-incremental-compilation") add("-Xic-cache-dir=$icCacheDir")