HMPP: Avoid false positive detection of "common native" as "common"

This commit is contained in:
Dmitriy Dolovov
2020-04-02 14:12:21 +07:00
parent b108b0f8c4
commit 0f60b5a71e
@@ -77,7 +77,13 @@ interface TargetPlatformVersion {
}
}
fun TargetPlatform?.isCommon(): Boolean = this != null && this.size > 1
fun TargetPlatform?.isCommon(): Boolean = this != null && size > 1 && iterator().let { i ->
val firstPlatformName = i.next().platformName
while (i.hasNext()) {
if (i.next().platformName != firstPlatformName) return@let true
}
false
}
fun SimplePlatform.toTargetPlatform(): TargetPlatform = TargetPlatform(setOf(this))