Skip to content

Commit dd5e4ca

Browse files
authored
Suppress enum-enum conversion warning on Linux cross compilers (#238)
We now only support GCC 11+, so we can remove the conditional flag inclusion.
1 parent b9c6572 commit dd5e4ca

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ java {
1313

1414
allprojects {
1515
group = "edu.wpi.first"
16-
version = "2025.8.0"
16+
version = "2025.9.0"
1717

1818
if (project.hasProperty('publishVersion')) {
1919
version = project.publishVersion

src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ public static class DefaultArguments {
5656

5757
public final String unixSymbolArg = "-g";
5858

59-
// -Wdeprecated-enum-enum-conversion was introduced in GCC 11
6059
public final List<String> linuxCrossCompilerArgs = List.of("-std=c++20", "-Wformat=2", "-pedantic",
61-
"-Wno-psabi", "-Wno-unused-parameter", "-fPIC", "-pthread");
62-
public final List<String> linuxCrossCompilerExtraArgs11 = List.of("-Wno-error=deprecated-enum-enum-conversion");
63-
public final List<String> linuxCrossCompilerExtraArgs10 = List.of("-Wno-error=deprecated-declarations");
60+
"-Wno-psabi", "-Wno-unused-parameter", "-Wno-error=deprecated-enum-enum-conversion", "-fPIC",
61+
"-pthread");
6462
public final List<String> linuxCrossCCompilerArgs = List.of("-Wformat=2", "-pedantic", "-Wno-psabi",
6563
"-Wno-unused-parameter", "-fPIC", "-pthread");
6664
public final List<String> linuxCrossLinkerArgs = List.of("-rdynamic", "-pthread", "-ldl", "-latomic", "-Wl,-rpath,'$ORIGIN'");
@@ -115,13 +113,8 @@ public static class Platforms {
115113
private final Map<String, PlatformConfig> windowsPlatforms = new HashMap<>();
116114
private final Map<String, PlatformConfig> unixPlatforms = new HashMap<>();
117115

118-
public void addLinuxCrossArgs(PlatformConfig platform, int gccMajor) {
116+
public void addLinuxCrossArgs(PlatformConfig platform) {
119117
platform.getCppCompiler().getArgs().addAll(defaultArguments.linuxCrossCompilerArgs);
120-
if (gccMajor >= 11) {
121-
platform.getCppCompiler().getArgs().addAll(defaultArguments.linuxCrossCompilerExtraArgs11);
122-
} else {
123-
platform.getCppCompiler().getArgs().addAll(defaultArguments.linuxCrossCompilerExtraArgs10);
124-
}
125118
platform.getcCompiler().getArgs().addAll(defaultArguments.linuxCrossCCompilerArgs);
126119
platform.getLinker().getArgs().addAll(defaultArguments.linuxCrossLinkerArgs);
127120
platform.getCppCompiler().getDebugArgs().addAll(defaultArguments.linuxCrossDebugCompilerArgs);
@@ -229,16 +222,16 @@ public WPINativeUtilsExtension(NativeUtilsExtension nativeExt, Project project)
229222
unixPlatforms.put(platforms.systemcore, linuxsystemcore);
230223

231224
linuxathena.getPlatformPath().set("linux/athena");
232-
addLinuxCrossArgs(linuxathena, 12);
225+
addLinuxCrossArgs(linuxathena);
233226

234227
linuxsystemcore.getPlatformPath().set("linux/systemcore");
235-
addLinuxCrossArgs(linuxsystemcore, 12);
228+
addLinuxCrossArgs(linuxsystemcore);
236229

237230
linuxarm32.getPlatformPath().set("linux/arm32");
238-
addLinuxCrossArgs(linuxarm32, 10);
231+
addLinuxCrossArgs(linuxarm32);
239232

240233
linuxarm64.getPlatformPath().set("linux/arm64");
241-
addLinuxCrossArgs(linuxarm64, 10);
234+
addLinuxCrossArgs(linuxarm64);
242235

243236
windowsx86.getPlatformPath().set("windows/x86");
244237
addWindowsArgs(windowsx86);
@@ -256,13 +249,6 @@ public WPINativeUtilsExtension(NativeUtilsExtension nativeExt, Project project)
256249
addMacArgs(osxuniversal);
257250
}
258251

259-
public void addGcc11CrossArgs(String platform) {
260-
PlatformConfig config = unixPlatforms.get(platform);
261-
if (config != null) {
262-
config.getCppCompiler().getArgs().addAll(defaultArguments.linuxCrossCompilerExtraArgs11);
263-
}
264-
}
265-
266252
public void addMacMinimumVersionArg() {
267253
PlatformConfig platform = unixPlatforms.get(platforms.osxuniversal);
268254
platform.getcCompiler().getArgs().add(defaultArguments.macMinimumVersionArg);

testing/cpp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import edu.wpi.first.nativeutils.vendordeps.WPIVendorDepsPlugin
33

44
plugins {
55
id "cpp"
6-
id "edu.wpi.first.NativeUtils" version "2025.8.0"
6+
id "edu.wpi.first.NativeUtils" version "2025.9.0"
77
}
88

99
nativeUtils.addWpiNativeUtils()

0 commit comments

Comments
 (0)