Skip to content

Commit d39c5c2

Browse files
authored
Allow on device builds on arm platforms (#12)
1 parent fb60817 commit d39c5c2

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

libssh.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ types.each { type ->
2828
args "-DCMAKE_OSX_ARCHITECTURES=x86_64", "-DCMAKE_OSX_DEPLOYMENT_TARGET=\"10.15\""
2929
environment "ARCHFLAGS", "-arch x86_64"
3030
} else if (project.platform == "linux-arm64") {
31-
args "-DCMAKE_TOOLCHAIN_FILE=$rootDir/cmake/aarch64-bullseye-gnu.toolchain.cmake"
31+
if (project.hasProperty('forcecrossbuild')) {
32+
args "-DCMAKE_TOOLCHAIN_FILE=$rootDir/cmake/aarch64-bullseye-gnu.toolchain.cmake"
33+
}
3234
args "-DOPENSSL_CRYPTO_LIBRARY=${project.openssl_install}/lib/libcrypto.a"
3335
args "-DOPENSSL_SSL_LIBRARY=${project.openssl_install}/lib/libssl.a"
3436
args "-DOPENSSL_INCLUDE_DIR=${project.openssl_install}/include"
3537
} else if (project.platform == "linux-arm32") {
36-
args "-DCMAKE_TOOLCHAIN_FILE=$rootDir/cmake/arm-pi-gnueabihf.toolchain.cmake"
38+
if (project.hasProperty('forcecrossbuild')) {
39+
args "-DCMAKE_TOOLCHAIN_FILE=$rootDir/cmake/arm-pi-gnueabihf.toolchain.cmake"
40+
}
3741
args "-DOPENSSL_CRYPTO_LIBRARY=${project.openssl_install}/lib/libcrypto.a"
3842
args "-DOPENSSL_SSL_LIBRARY=${project.openssl_install}/lib/libssl.a"
3943
args "-DOPENSSL_INCLUDE_DIR=${project.openssl_install}/include"

openssl.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ project.tasks.create("configureOpenSSL", Exec) {
3030
args "linux-armv4"
3131
args "-DL_ENDIAN"
3232
args "-latomic"
33-
args "--cross-compile-prefix=armv6-bullseye-linux-gnueabihf-"
33+
if (project.hasProperty('forcecrossbuild')) {
34+
args "--cross-compile-prefix=armv6-bullseye-linux-gnueabihf-"
35+
}
3436
} else if (project.platform == "linux-athena") {
3537
args "linux-armv4"
3638
args "-DL_ENDIAN"
3739
args "-latomic"
3840
args "--cross-compile-prefix=arm-frc2023-linux-gnueabi-"
3941
} else if (project.platform == "linux-arm64") {
4042
args "linux-aarch64"
41-
args "--cross-compile-prefix=aarch64-bullseye-linux-gnu-"
43+
if (project.hasProperty('forcecrossbuild')) {
44+
args "--cross-compile-prefix=aarch64-bullseye-linux-gnu-"
45+
}
4246
}
4347
}
4448

0 commit comments

Comments
 (0)