Skip to content

Commit

Permalink
add toolchains sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Jun 15, 2024
1 parent d71da94 commit a650de1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
mv ${{ matrix.bookworm-type }} bookworm-toolchain
- name: Shim toolchain dir (non-bookworm)
if: (!startsWith(matrix.artifact-name, 'Bookworm'))
run: mkdir bookworm-toolchain
run: mkdir /work/bookworm-toolchain
- name: Test toolchain
if: startsWith(matrix.artifact-name, 'Bookworm')
run: bookworm-toolchain/bin/${{ matrix.bookworm-prefix }}g++ -v
Expand Down
43 changes: 43 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,49 @@ plugins {
id 'com.google.protobuf' version '0.9.3' apply false
}

nativeUtils.addWpiNativeUtils()
if(project.hasProperty("bookworm")) {
toolchainsPlugin.crossCompilers {
bookworm-linuxarm64 {
architecture = "arm"
compilerPrefix = "aarch64-bookworm-linux-gnu-"
operatingSystem = "linux"
optional = false
}
}
nativeUtils.platformConfigs {
bookworm-linuxarm64 {
platformPath = "linux/bookworm-arm64"
cppCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCompilerArgs);
cCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCCompilerArgs);
linker.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossLinkerArgs);
cppCompiler.debugArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossDebugCompilerArgs);
cppCompiler.releaseArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossReleaseCompilerArgs);
}
}
}

if(project.hasProperty("raspi-bookworm")) {
toolchainsPlugin.crossCompilers {
bookworm-linuxarm32 {
architecture = "arm"
compilerPrefix = "armv6-bookworm-linux-gnueabihf-"
operatingSystem = "linux"
optional = false
}
}
nativeUtils.platformConfigs {
bookworm-linuxarm32 {
platformPath = "linux/bookworm-arm32"
cppCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCompilerArgs);
cCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCCompilerArgs);
linker.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossLinkerArgs);
cppCompiler.debugArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossDebugCompilerArgs);
cppCompiler.releaseArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossReleaseCompilerArgs);
}
}
}

wpilibVersioning.buildServerMode = project.hasProperty('buildServer')
wpilibVersioning.releaseMode = project.hasProperty('releaseMode')

Expand Down
44 changes: 0 additions & 44 deletions shared/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,6 @@ nativeUtils {
}
}

if(project.hasProperty("bookworm")) {
toolchainsPlugin.crossCompilers {
bookworm-linuxarm64 {
architecture = "arm"
compilerPrefix = "aarch64-bookworm-linux-gnu-"
operatingSystem = "linux"
optional = false
}
}
nativeUtils.platformConfigs {
bookworm-linuxarm64 {
platformPath = "linux/bookworm-arm64"
cppCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCompilerArgs);
cCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCCompilerArgs);
linker.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossLinkerArgs);
cppCompiler.debugArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossDebugCompilerArgs);
cppCompiler.releaseArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossReleaseCompilerArgs);
}
}
}

if(project.hasProperty("raspi-bookworm")) {
toolchainsPlugin.crossCompilers {
bookworm-linuxarm32 {
architecture = "arm"
compilerPrefix = "armv6-bookworm-linux-gnueabihf-"
operatingSystem = "linux"
optional = false
}
}
nativeUtils.platformConfigs {
bookworm-linuxarm32 {
platformPath = "linux/bookworm-arm32"
cppCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCompilerArgs);
cCompiler.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossCCompilerArgs);
linker.args.addAll(nativeUtils.wpi.defaultArguments.linuxCrossLinkerArgs);
cppCompiler.debugArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossDebugCompilerArgs);
cppCompiler.releaseArgs.addAll(nativeUtils.wpi.defaultArguments.linuxCrossReleaseCompilerArgs);
}
}
}



nativeUtils.wpi.addWarnings()
nativeUtils.wpi.addWarningsAsErrors()

Expand Down

0 comments on commit a650de1

Please sign in to comment.