How to build for all architectures? #4528
-
I need to build for: Mac:
Windows:
Linux:
I also need all this to automated by Github Actions but I am not familiar with the process. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
The following guide should help you: |
Beta Was this translation helpful? Give feedback.
-
There's channels you can look through on the Discord for various architectures. E.g. arm is something people have worked with quite a bunch. There's a lot of stuff to consider when doing cross compiling. I'm currently pursuing using this project: https://github.com/cross-rs/cross |
Beta Was this translation helpful? Give feedback.
-
I'm building ( FROM debian:bullseye-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --assume-yes --no-install-recommends \
gnupg2 \
ca-certificates \
g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross \
libclang-3.9-dev \
build-essential \
pkg-config \
curl \
wget \
file
RUN dpkg --add-architecture armhf && \
apt-get update && apt-get install --assume-yes --no-install-recommends \
libwebkit2gtk-4.0-dev:armhf \
libssl-dev:armhf \
libgtk-3-dev:armhf \
libayatana-appindicator3-dev:armhf \
librsvg2-dev:armhf \
libatk1.0-dev:armhf \
libgdk-pixbuf-2.0-dev:armhf \
libcairo2-dev:armhf \
libpango1.0-dev:armhf \
libgtk-3-dev:armhf \
libsoup2.4-dev:armhf
# Install NodeJs and Yarn
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add &&\
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list &&\
apt-get update && apt-get install --assume-yes --no-install-recommends \
nodejs \
yarn
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target armv7-unknown-linux-gnueabihf
# Set envs
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \
BINDGEN_EXTRA_CLANG_ARGS_armv7_unknown_linux_gnueabihf="--sysroot=/usr/arm-linux-gnueabihf" \
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/:${PKG_CONFIG_PATH}" \
PKG_CONFIG_ALLOW_CROSS=1 \
PATH="/root/.cargo/bin:$PATH"
WORKDIR /app I built it like: docker build \
-t $USER/tauri-cross:armv7-unknown-linux-gnueabihf \
--output type=registry \
--progress=plain \
docker/armv7-unknown-linux-gnueabihf/ and then I run with docker run --rm -it -v $PWD:/app \
$USER/tauri-cross:armv7-unknown-linux-gnueabihf bash \
-c "yarn tauri build --target armv7-unknown-linux-gnueabihf" Hope it helps |
Beta Was this translation helpful? Give feedback.
There's channels you can look through on the Discord for various architectures. E.g. arm is something people have worked with quite a bunch. There's a lot of stuff to consider when doing cross compiling. I'm currently pursuing using this project: https://github.com/cross-rs/cross