Skip to content

Commit 102c4c8

Browse files
committed
Improve architecture detection.
1 parent e007bb8 commit 102c4c8

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ This assumes that the OpenCV artifacts are located in the FRC maven repository a
66
For now, this is just a CLI app with no GUI.
77

88
## Supported platforms
9-
This currently supports
10-
- Windows (32- and 64-bit)
11-
- Mac OS X 10.4 or higher
12-
- Linux (32- and 64-bit)
9+
This currently supports
10+
11+
- Windows (32- and 64-bit)
12+
- Mac OS X 10.4 or higher
13+
- Linux (32- and 64-bit)
14+
15+
ARM/Android is not currently supported.
1316

1417
## Command line arguments
1518

src/main/java/edu/wpi/first/wpilib/opencv/installer/PlatformDetector.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private static String getOs() throws UnsupportedOperatingSystemError {
3232
} else if (osName.contains("linux")) {
3333
os = "linux";
3434
} else {
35-
throw new UnsupportedOperatingSystemError(osName);
35+
throw new UnsupportedOperatingSystemError("Unsupported OS: " + osName);
3636
}
3737
return os;
3838
}
@@ -45,16 +45,19 @@ private static String getOs() throws UnsupportedOperatingSystemError {
4545
* </ul>
4646
*
4747
* @return the operating system architecture
48+
* @throws UnsupportedOperatingSystemError if the architecture is not supported
4849
*/
49-
private static String getArch() {
50+
private static String getArch() throws UnsupportedOperatingSystemError {
5051
if (arch != null) {
5152
return arch;
5253
}
53-
String arch = System.getProperty("os.arch");
54-
if (arch.matches("^(i386|x86)$")) {
54+
String archName = System.getProperty("os.arch");
55+
if (archName.matches("^(i386|x86)$")) {
5556
arch = "32";
56-
} else {
57+
} else if (archName.equals("x86_64")) {
5758
arch = "64";
59+
} else {
60+
throw new UnsupportedOperatingSystemError("Unsupported architecture: " + archName);
5861
}
5962
return arch;
6063
}

0 commit comments

Comments
 (0)