Can I in cargo/config.toml
change settings and env variables depending on the OS on which the build takes place: x86_64-pc-windwos-msvc
(what is commented out), x86_64-unknown-linux-gnu
:
# [env]
# CC_x86_64_linux_android="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android34-clang"
# AR_x86_64_linux_android="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# CC_armv7-linux-androideabi="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi34-clang"
# AR_armv7-linux-androideabi="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# CC_i686_linux_android="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android34-clang"
# AR_i686_linux_android="/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# [target.armv7-linux-androideabi]
# ar = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# linker = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi34-clang"
# rustflags = [
# "-C", "link-arg=/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-arm-android.a"
# ]
# [target.x86_64-linux-android]
# ar = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# linker = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android34-clang"
# rustflags = [
# "-C", "link-arg=/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64-android.a"
# ]
# [target.i686-linux-android]
# ar = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
# linker = "/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android34-clang"
# rustflags = [
# "-C", "link-arg=/usr/local/android-ndk-r27b/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-i686-android.a"
# ]
[env]
CC_x86_64_linux_android="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android34-clang.cmd"
AR_x86_64_linux_android="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
CC_armv7-linux-androideabi="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi34-clang.cmd"
AR_armv7-linux-androideabi="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
CC_i686_linux_android="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android34-clang.cmd"
AR_i686_linux_android="D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
[target.armv7-linux-androideabi]
ar = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
linker = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi34-clang.cmd"
rustflags = [
"-C", "link-arg=D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-arm-android.a"
]
[target.x86_64-linux-android]
ar = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
linker = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android34-clang.cmd"
rustflags = [
"-C", "link-arg=D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-x86_64-android.a"
]
[target.i686-linux-android]
ar = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar"
linker = "D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android34-clang.cmd"
rustflags = [
"-C", "link-arg=D:/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/windows-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-i686-android.a"
]