mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-22 17:44:22 +00:00
Fix compilation where BUILD = TARGET platform
This commit is contained in:
parent
6532748d6c
commit
1d91b2619d
1 changed files with 13 additions and 11 deletions
24
Dockerfile
24
Dockerfile
|
@ -21,17 +21,19 @@ RUN \
|
|||
mkdir .cargo && \
|
||||
echo '[net]' >> .cargo/config.toml && \
|
||||
echo 'git-fetch-with-cli = true' >> .cargo/config.toml && \
|
||||
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
||||
echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||
echo 'linker = "x86-64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||
fi && \
|
||||
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
||||
echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||
echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||
fi && \
|
||||
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
|
||||
echo '[target.armv7-unknown-linux-gnueabihf]' >> .cargo/config.toml; \
|
||||
echo 'linker = "arm-linux-gnueabihf-gcc"' >> .cargo/config.toml; \
|
||||
if [ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]; then \
|
||||
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
||||
echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||
echo 'linker = "x86-64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||
fi && \
|
||||
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
||||
echo '[target.aarch64-unknown-linux-gnu]' >> .cargo/config.toml; \
|
||||
echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml; \
|
||||
fi && \
|
||||
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
|
||||
echo '[target.armv7-unknown-linux-gnueabihf]' >> .cargo/config.toml; \
|
||||
echo 'linker = "arm-linux-gnueabihf-gcc"' >> .cargo/config.toml; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
RUN rustup target add ${RUSTTARGET}
|
||||
|
|
Loading…
Reference in a new issue