diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt index f9e70b3047d..3be2d309483 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CacheSupport.kt @@ -52,15 +52,17 @@ class CacheSupport( val hasCachedLibs = explicitCacheFiles.isNotEmpty() || implicitCacheDirectories.isNotEmpty() - val optimized = configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) - if (optimized && hasCachedLibs) - configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used for optimized compilation") + val ignoreReason = when { + configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) -> "for optimized compilation" + configuration.getBoolean(KonanConfigKeys.PROPERTY_LAZY_INITIALIZATION) -> "with experimental lazy top levels initialization" + else -> null + } - val usePropertyLazyInitialization = configuration.getBoolean(KonanConfigKeys.PROPERTY_LAZY_INITIALIZATION) - if (usePropertyLazyInitialization && hasCachedLibs) - configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used with experimental lazy top levels initialization") + if (ignoreReason != null && hasCachedLibs) { + configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used $ignoreReason") + } - val ignoreCachedLibraries = optimized || usePropertyLazyInitialization + val ignoreCachedLibraries = ignoreReason != null CachedLibraries( target = target, allLibraries = allLibraries,