Skip to content

Commit cf73fd1

Browse files
committed
fix build
1 parent b639a0a commit cf73fd1

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

buildSrc/src/main/kotlin/HmppConfigure.kt

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ val HOST_KIND by lazy {
6464
HostKind.MACOS_X64
6565
}
6666
}
67+
6768
else -> HostKind.LINUX
6869
}
6970
}
@@ -74,13 +75,15 @@ enum class HostArch {
7475

7576
/// eg. "!a;!b" means to enable all targets but a or b
7677
/// eg. "a;b;!other" means to disable all targets but a or b
77-
val ENABLED_TARGETS = System.getProperty(
78-
"mirai.target",
79-
if (IDEA_ACTIVE)
80-
"jvm;android;${HOST_KIND.targetName};!other"
81-
else
82-
""
83-
).split(';').toSet()
78+
val ENABLED_TARGETS by lazy {
79+
System.getProperty(
80+
"mirai.target",
81+
if (IDEA_ACTIVE)
82+
"jvm;android;${HOST_KIND.targetName};!other"
83+
else
84+
""
85+
).split(';').toSet()
86+
}
8487

8588
fun isTargetEnabled(name: String): Boolean {
8689
return when {
@@ -93,7 +96,7 @@ fun isTargetEnabled(name: String): Boolean {
9396
fun Set<String>.filterTargets() =
9497
this.filter { isTargetEnabled(it) }.toSet()
9598

96-
val MAC_TARGETS: Set<String> =
99+
val MAC_TARGETS: Set<String> by lazy {
97100
setOf(
98101
// "watchosX86",
99102
"macosX64",
@@ -116,14 +119,15 @@ val MAC_TARGETS: Set<String> =
116119
// "tvosArm64",
117120
// "tvosSimulatorArm64",
118121
).filterTargets()
122+
}
119123

120-
val WIN_TARGETS = setOf("mingwX64").filterTargets()
124+
val WIN_TARGETS by lazy { setOf("mingwX64").filterTargets() }
121125

122-
val LINUX_TARGETS = setOf("linuxX64").filterTargets()
126+
val LINUX_TARGETS by lazy { setOf("linuxX64").filterTargets() }
123127

124-
val UNIX_LIKE_TARGETS = LINUX_TARGETS + MAC_TARGETS
128+
val UNIX_LIKE_TARGETS by lazy { LINUX_TARGETS + MAC_TARGETS }
125129

126-
val NATIVE_TARGETS = UNIX_LIKE_TARGETS + WIN_TARGETS
130+
val NATIVE_TARGETS by lazy { UNIX_LIKE_TARGETS + WIN_TARGETS }
127131

128132
fun Project.configureJvmTargetsHierarchical() {
129133
extensions.getByType(KotlinMultiplatformExtension::class.java).apply {
@@ -255,7 +259,7 @@ fun KotlinMultiplatformExtension.configureNativeTargetsHierarchical(
255259
}
256260
}
257261
val darwinTest by lazy {
258-
this.sourceSets.maybeCreate("darwinTest") .apply {
262+
this.sourceSets.maybeCreate("darwinTest").apply {
259263
dependsOn(unixTest)
260264
}
261265
}

0 commit comments

Comments
 (0)