diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/DependenciesTracker.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/DependenciesTracker.kt index 3c377916b79..47acf5bae9e 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/DependenciesTracker.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/DependenciesTracker.kt @@ -193,7 +193,7 @@ internal class DependenciesTrackerImpl( } } - if (filesUsed.isEmpty()) { + if (filesUsed.isEmpty() || library in config.resolve.includedLibraries) { // This is the case when we depend on the whole module rather than on a number of files. moduleDependencies.add(library) addAllDependencies(cache) diff --git a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global1.kt b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global1.kt index 652e188a400..7e6bbc0b21c 100644 --- a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global1.kt +++ b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global1.kt @@ -2,8 +2,6 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -// KT-64408: when undisabled (by removing next line), the compiled .kexe wrongly contains no tests -// DISABLE_NATIVE: cacheMode=STATIC_PER_FILE_EVERYWHERE // FILE: lib.kt var z1 = false diff --git a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global2.kt b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global2.kt index 43cd96ae08d..cb2949d0dec 100644 --- a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global2.kt +++ b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/global2.kt @@ -2,8 +2,6 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -// KT-64408: when undisabled (by removing next line), the compiled .kexe wrongly contains no tests -// DISABLE_NATIVE: cacheMode=STATIC_PER_FILE_EVERYWHERE // FILE: lib.kt var z1 = false diff --git a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal1.kt b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal1.kt index f4bd0179e54..a95540cb5b8 100644 --- a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal1.kt +++ b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal1.kt @@ -2,8 +2,6 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -// KT-64408: when undisabled (by removing next line), the compiled .kexe wrongly contains no tests -// DISABLE_NATIVE: cacheMode=STATIC_PER_FILE_EVERYWHERE // FILE: lib.kt @ThreadLocal diff --git a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal2.kt b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal2.kt index dd48d1e6ff1..2450ef724f9 100644 --- a/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal2.kt +++ b/native/native.tests/testData/codegen/initializers/files/eagerInitialization/threadLocal2.kt @@ -2,8 +2,6 @@ * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -// KT-64408: when undisabled (by removing next line), the compiled .kexe wrongly contains no tests -// DISABLE_NATIVE: cacheMode=STATIC_PER_FILE_EVERYWHERE // FILE: lib.kt @ThreadLocal