diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/EnabledTargets.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/EnabledTargets.kt new file mode 100644 index 00000000000..c1b32c3c5d3 --- /dev/null +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/EnabledTargets.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2010-2023 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. + */ + +package org.jetbrains.kotlin.konan.target + +fun enabledTargets(platformManager: PlatformManager) = platformManager.enabled.filterNot { + it in KonanTarget.deprecatedTargets && it !in KonanTarget.toleratedDeprecatedTargets +} diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/TargetWithSanitizer.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/TargetWithSanitizer.kt index 533e8992926..35fcf342d06 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/TargetWithSanitizer.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/konan/target/TargetWithSanitizer.kt @@ -49,8 +49,8 @@ fun KonanTarget.withSanitizer(sanitizer: SanitizerKind? = null) = TargetWithSani * All known targets with their sanitizers. */ val PlatformManager.allTargetsWithSanitizers - get() = this.enabled.flatMap { target -> + get() = enabledTargets(this).flatMap { target -> listOf(target.withSanitizer()) + target.supportedSanitizers().map { target.withSanitizer(it) } - } \ No newline at end of file + } diff --git a/kotlin-native/build.gradle b/kotlin-native/build.gradle index 10135ac5a48..c500fdb22bb 100644 --- a/kotlin-native/build.gradle +++ b/kotlin-native/build.gradle @@ -98,8 +98,8 @@ allprojects { void setupHostAndTarget() { ext.hostName = platformManager.hostName - ext.targetList = platformManager.enabled.collect { it.visibleName } as List - ext.konanTargetList = platformManager.enabled as List + ext.targetList = EnabledTargetsKt.enabledTargets(platformManager).collect { it.visibleName } as List + ext.konanTargetList = EnabledTargetsKt.enabledTargets(platformManager) as List } void setupClang(Project project) { diff --git a/kotlin-native/dependencies/build.gradle b/kotlin-native/dependencies/build.gradle index 1cab77e0f65..83b2b889898 100644 --- a/kotlin-native/dependencies/build.gradle +++ b/kotlin-native/dependencies/build.gradle @@ -75,7 +75,7 @@ enum DependencyKind { def platformManager = rootProject.project(":kotlin-native").ext.platformManager -platformManager.enabled.each { target -> +EnabledTargetsKt.enabledTargets(platformManager).each { target -> def loader = platformManager.loader(target) tasks.register("${target}Dependencies", NativeDep) { diff --git a/kotlin-native/runtime/build.gradle.kts b/kotlin-native/runtime/build.gradle.kts index e847d1d8620..dcd3a01f286 100644 --- a/kotlin-native/runtime/build.gradle.kts +++ b/kotlin-native/runtime/build.gradle.kts @@ -165,8 +165,6 @@ bitcode { } compilerArgs.add("-DCUSTOM_ALLOCATOR") - - onlyIf { target.supportsThreads() } } module("opt_alloc") { @@ -237,8 +235,6 @@ bitcode { testFixtures {} test {} } - - onlyIf { target.supportsThreads() } } module("experimental_memory_manager_custom") { @@ -251,8 +247,6 @@ bitcode { } compilerArgs.add("-DCUSTOM_ALLOCATOR") - - onlyIf { target.supportsThreads() } } module("common_gc") { @@ -262,8 +256,6 @@ bitcode { main {} test {} } - - onlyIf { target.supportsThreads() } } module("noop_gc") { @@ -273,8 +265,6 @@ bitcode { main {} testFixtures {} } - - onlyIf { target.supportsThreads() } } module("noop_gc_custom") { @@ -286,8 +276,6 @@ bitcode { } compilerArgs.add("-DCUSTOM_ALLOCATOR") - - onlyIf { target.supportsThreads() } } module("same_thread_ms_gc") { @@ -298,8 +286,6 @@ bitcode { testFixtures {} test {} } - - onlyIf { target.supportsThreads() } } module("same_thread_ms_gc_custom") { @@ -312,8 +298,6 @@ bitcode { } compilerArgs.add("-DCUSTOM_ALLOCATOR") - - onlyIf { target.supportsThreads() } } module("concurrent_ms_gc") { @@ -324,8 +308,6 @@ bitcode { testFixtures {} test {} } - - onlyIf { target.supportsThreads() } } module("concurrent_ms_gc_custom") { @@ -338,8 +320,6 @@ bitcode { } compilerArgs.add("-DCUSTOM_ALLOCATOR") - - onlyIf { target.supportsThreads() } } module("common_gcScheduler") { @@ -349,8 +329,6 @@ bitcode { main {} test {} } - - onlyIf { target.supportsThreads() } } module("manual_gcScheduler") { @@ -359,8 +337,6 @@ bitcode { sourceSets { main {} } - - onlyIf { target.supportsThreads() } } module("adaptive_gcScheduler") { @@ -370,8 +346,6 @@ bitcode { main {} test {} } - - onlyIf { target.supportsThreads() } } module("aggressive_gcScheduler") { @@ -381,8 +355,6 @@ bitcode { main {} test {} } - - onlyIf { target.supportsThreads() } } testsGroup("custom_alloc_runtime_tests") {