gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
92 stars 8 forks source link

Do not add the host as a target machine when any target machines have been defined for a native component #928

Closed adammurdoch closed 5 years ago

adammurdoch commented 5 years ago

When I have this in a build script:

application {
    targetMachines.add(machines.windows())
}

then I end up with 2 variants: one for windows and one for the host. We should make this less confusing. Arguably, it's a usability issue with SetProperty, but it should probably also be an error to have target machines contain the implicit host target machine and any other value, regardless of how the values end up in the set.

big-guy commented 5 years ago

Could be 2 approaches:

We should also check if host is contained in the set when other targets are specified. Targetting [host, windows] doesn't make sense.

big-guy commented 5 years ago

see #918

lacasseio commented 5 years ago

PR https://github.com/gradle/gradle/pull/7801 remove TargetMachineFactory#host() from public API and use an ad-hoc default value configuration on the targetMachines property.

lacasseio commented 5 years ago

A similar issue yet different is handled in PR https://github.com/gradle/gradle-native/issues/944.