Native: improve code that handles unsupported compiler caches
This commit is contained in:
committed by
Space
parent
02d8c7527e
commit
4abbac1ff1
+9
-7
@@ -52,15 +52,17 @@ class CacheSupport(
|
|||||||
|
|
||||||
val hasCachedLibs = explicitCacheFiles.isNotEmpty() || implicitCacheDirectories.isNotEmpty()
|
val hasCachedLibs = explicitCacheFiles.isNotEmpty() || implicitCacheDirectories.isNotEmpty()
|
||||||
|
|
||||||
val optimized = configuration.getBoolean(KonanConfigKeys.OPTIMIZATION)
|
val ignoreReason = when {
|
||||||
if (optimized && hasCachedLibs)
|
configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) -> "for optimized compilation"
|
||||||
configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used 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 (ignoreReason != null && hasCachedLibs) {
|
||||||
if (usePropertyLazyInitialization && hasCachedLibs)
|
configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used $ignoreReason")
|
||||||
configuration.report(CompilerMessageSeverity.WARNING, "Cached libraries will not be used with experimental lazy top levels initialization")
|
}
|
||||||
|
|
||||||
val ignoreCachedLibraries = optimized || usePropertyLazyInitialization
|
val ignoreCachedLibraries = ignoreReason != null
|
||||||
CachedLibraries(
|
CachedLibraries(
|
||||||
target = target,
|
target = target,
|
||||||
allLibraries = allLibraries,
|
allLibraries = allLibraries,
|
||||||
|
|||||||
Reference in New Issue
Block a user