此命令序列可用于在 Ubuntu 上快速编译 KiCad
添加仓库以便我们可以安装构建依赖
build_kicad_ubuntu.sh
sudo add-apt-repository --enable-source --yes ppa:kicad/kicad-8.0-releases
sudo apt update安装构建依赖
install_dependencies.sh
sudo apt build-dep kicad
# Install other build tools
apt -y install ninja-build mold libprotobuf-dev protobuf-compiler python3-pip
# Install Python dependencies
pip install --user --break-system-packages wxpython克隆 KiCad 源代码
clone_kicad.sh
git clone https://gitlab.com/kicad/code/kicad.git可选地,你可以检出特定分支,但大多数用户会想要构建 master,这是默认检出的。
使用 ninja 构建 KiCad
build_kicad.sh
mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo -DCMAKE_CXX_FLAGS=-fuse-ld=mold ../../
ninja -j8如果这篇文章对您有帮助,请考虑请我喝杯咖啡或通过 PayPal 捐款,以支持 TechOverflow 上新文章的研究与发布