Show warnings for disabled targets on current host

Issue #KT-26647 Fixed
This commit is contained in:
Sergey Igushkin
2018-09-21 20:05:31 +03:00
parent 4f650bb056
commit 81ae54c05b
2 changed files with 40 additions and 26 deletions
@@ -324,6 +324,20 @@ class KotlinNativeTargetPreset(
}
}
if (!konanTarget.enabledOnCurrentHost) {
with(HostManager()) {
val supportedHosts = enabledTargetsByHost.filterValues { konanTarget in it }.keys
val supportedHostsString =
if (supportedHosts.size == 1)
"a ${supportedHosts.single()} host" else
"one of the host platforms: ${supportedHosts.joinToString(", ")}"
project.logger.warn(
"Target '$name' for platform ${konanTarget} is ignored during build on this ${HostManager.host} machine. " +
"You can build it with $supportedHostsString."
)
}
}
return result
}