Add rust cross-compile
This commit is contained in:
@@ -43,13 +43,20 @@ RUN cd /opt && \
|
||||
make -j$(nproc) MXE_TARGETS=x86_64-w64-mingw32.static qtbase qtwebsockets
|
||||
|
||||
# Add rust
|
||||
RUN apt install -y gcc-aarch64-linux-gnu
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.32.0 -y
|
||||
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
|
||||
RUN ~/.cargo/bin/rustup target add x86_64-pc-windows-gnu
|
||||
RUN ~/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
|
||||
|
||||
# Append the linker to the cargo config for Windows cross compile
|
||||
RUN echo "[target.x86_64-pc-windows-gnu]" >> ~/.cargo/config && \
|
||||
echo "linker = 'x86_64-w64-mingw32.static-gcc'" >> ~/.cargo/config
|
||||
|
||||
RUN echo "[target.aarch64-unknown-linux-gnu]" >> ~/.cargo/config && \
|
||||
echo "linker = '/usr/bin/aarch64-linux-gnu-gcc'" >> ~/.cargo/config
|
||||
|
||||
ENV CC_x86_64_pc_windows_gnu="x86_64-w64-mingw32.static-gcc"
|
||||
ENV CC_aarch64_unknown_linux_gnu="aarch64-linux-gnu-gcc"
|
||||
ENV PATH="/opt/mxe/usr/bin:${PATH}"
|
||||
|
||||
Reference in New Issue
Block a user