@@ -34,37 +34,23 @@ model {
34
34
}
35
35
}
36
36
37
- // The toolChains block is needed because Gradle doesn't find gcc/clang on ARM-based Linux
38
- // and macOS platforms without explicitly declaring their targets. Might be a bug in the
39
- // native Gradle plugin.
37
+ // The toolChains block is needed because Gradle doesn't find the native toolchain in various
38
+ // scenarios. These checks, can be removed when Gradle fixes them, and we advertise a
39
+ // minimum Gradle version that includes the fix.
40
40
toolChains {
41
- if (isCurrentLinux()) {
42
- gcc(Gcc ) {
43
- if (isCurrentArm_64()) {
44
- target(" linux_arm_64" )
45
- }
46
- }
41
+ def current = getCurrentPlatformName()
42
+ if (isLinux(current)) {
43
+ // https://github.com/gradle/gradle/issues/17660 (fixed in Gradle 8.11)
44
+ gcc(Gcc ). target(current)
45
+ clang(Clang ). target(current)
47
46
}
48
- if (isCurrentMac()) {
49
- clang(Clang ) {
50
- if (isCurrentArm_64()) {
51
- target(" mac_arm_64" )
52
- }
53
- }
54
- }
55
- if (isCurrentFreeBSD()) {
56
- gcc(Gcc ) {
57
- if (isCurrentArm_64()) {
58
- target(" freebsd_arm_64" )
59
- }
60
- else {
61
- target(" freebsd_x86_64" )
62
- }
63
- }
47
+ if (isFreeBSD(current)) {
48
+ // https://github.com/gradle/gradle/issues/32895
49
+ gcc(Gcc ). target(current)
50
+ clang(Clang ). target(current)
64
51
}
65
- if (isCurrentWindows() && VISUAL_STUDIO_INSTALL_DIR ) {
66
- // specify installDir because Gradle doesn't find VS Build Tools.
67
- // See https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
52
+ if (isWindows(current) && VISUAL_STUDIO_INSTALL_DIR ) {
53
+ // https://github.com/gradle/gradle-native/issues/617#issuecomment-575735288
68
54
visualCpp(VisualCpp ) {
69
55
installDir = VISUAL_STUDIO_INSTALL_DIR
70
56
}
0 commit comments