Red Panda C++ need Qt 5.15 to build.
Recommended development environments:
To setup development environment in Visual Studio Code:
0. (Windows only) Enable Developer Mode in Windows Settings, and enable core.symlinks
in Git (git config core.symlinks true
).
.vscode/compile_commands.json
(“C/C++: Edit Configurations (UI)” from the Command Palette);--compile-commands-dir=.vscode
;--qt=/usr
for example.* Note: xmake was introduced for compilation database generation and feature matrix test. It is not fully functional yet.
For Windows 7 or later:
Library + Toolchain \ Target | x86 | x64 | ARM64 |
---|---|---|---|
MSYS2 + GNU-based MinGW | ✔️ | ✔️ | ❌ |
MSYS2 + LLVM-based MinGW | ✔️ | ✔️ | ✔️ |
Qt.io + MinGW | ✔️ | ✔️ | ❌ |
Qt.io + MSVC | ✔️ | ✔️ | ❌ |
vcpkg + MSVC | ✔️ | ✔️ | ❌ |
qmake variables:
PREFIX
: where $MAKE install
installs files to.WINDOWS_PREFER_OPENCONSOLE=ON
(make phase): prefer UTF-8 compatible OpenConsole.exe
.
OpenConsole.exe
is a part of Windows Terminal. UTF-8 input support was added in version 1.18.OpenConsole.exe
requires ConPTY, which was introduced in Windows 10 1809.Notes for Windows on ARM:
For legacy Windows (NT 5.1 – 6.0):
Library + Toolchain \ Target | x86 | x64 |
---|---|---|
Qt 5.6 from patched source + MinGW | ✔️ | ✔️ |
Notes for legacy Windows:
Red Panda C++ should work with any MinGW toolchain from MSYS2, including GCCs and Clangs in three GNU-based environments (MINGW32, MINGW64 and UCRT64), and Clangs in three LLVM-based environments (CLANG32, CLANG64 and CLANGARM64; see also MSYS2’s document), while the following toolchains are frequently tested:
Official distributions of Red Panda C++ are built with MINGW32 GCC and MINGW64 GCC.
Prerequisites:
pacman -S $MINGW_PACKAGE_PREFIX-toolchain $MINGW_PACKAGE_PREFIX-qt5-static
To build:
SRC_DIR="/c/src/redpanda-src" # “C:\src\redpanda-src” for example
BUILD_DIR="/c/src/redpanda-build" # “C:\src\redpanda-build” for example
INSTALL_DIR="/c/src/redpanda-pkg" # “C:\src\redpanda-pkg” for example
rm -rf "$BUILD_DIR" # optional for clean build
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
$MSYSTEM_PREFIX/qt5-static/bin/qmake PREFIX="$INSTALL_DIR" "$SRC_DIR/Red_Panda_CPP.pro"
mingw32-make -j$(nproc)
mingw32-make install
Prerequisites:
To build:
rem no quotes even if path contains spaces
set SRC_DIR=C:\src\redpanda-src
set BUILD_DIR=C:\src\redpanda-build
set INSTALL_DIR=C:\src\redpanda-pkg
rem for MSVC toolchain
set VS_INSTALL_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community
rem for MSVC toolchain; or x86
set VC_ARCH=amd64
rem for MSVC toolchain; keep unset if Qt Creator is not installed
set QT_CREATOR_DIR=C:\Qt\Tools\QtCreator
rem optional for clean build
rmdir /s /q "%BUILD_DIR%"
mkdir "%BUILD_DIR%" && cd /d "%BUILD_DIR%"
qmake PREFIX="%INSTALL_DIR%" "%SRC_DIR%\Red_Panda_CPP.pro"
mingw32-make -j%NUMBER_OF_PROCESSORS%
mingw32-make install
windeployqt "%INSTALL_DIR%\RedPandaIDE.exe"
call "%VS_INSTALL_PATH%\Common7\Tools\VsDevCmd.bat" -arch=%VC_ARCH%
qmake PREFIX="%INSTALL_DIR%" "%SRC_DIR%\Red_Panda_CPP.pro"
set JOM=%QT_CREATOR_DIR%\bin\jom\jom.exe
if "%QT_CREATOR_DIR%" neq "" (
"%JOM%" -j%NUMBER_OF_PROCESSORS%
"%JOM%" install
) else (
nmake
nmake install
)
windeployqt "%INSTALL_DIR%\RedPandaIDE.exe"
Prerequisites:
$TARGET = "x64-windows-static" # or "x86-windows-static"
vcpkg install qt5-base:$TARGET qt5-svg:$TARGET qt5-tools:$TARGET
To build with VS 2019 or later in PowerShell (Core) or Windows PowerShell:
$SRC_DIR = "C:\src\redpanda-src"
$BUILD_DIR = "C:\src\redpanda-build"
$INSTALL_DIR = "C:\src\redpanda-pkg"
$VCPKG_ROOT = "C:\src\vcpkg"
$VCPKG_TARGET = "x64-windows-static" # or "x86-windows-static"
$VS_INSTALL_PATH = "C:\Program Files\Microsoft Visual Studio\2022\Community"
$VC_ARCH = "amd64" # or "x86"
$JOM = "$VCPKG_ROOT\downloads\tools\jom\jom-1.1.3\jom.exe" # check the version
Remove-Item -Recurse -Force "$BUILD_DIR" # optional for clean build
(New-Item -ItemType Directory -Force "$BUILD_DIR") -and (Set-Location "$BUILD_DIR")
Import-Module "$VS_INSTALL_PATH\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath "$VS_INSTALL_PATH" -SkipAutomaticLocation -DevCmdArguments "-arch=$VC_ARCH"
& "$VCPKG_ROOT\installed\$VCPKG_TARGET\tools\qt5\bin\qmake.exe" PREFIX="$INSTALL_DIR" "$SRC_DIR\Red_Panda_CPP.pro"
& "$JOM" "-j${Env:NUMBER_OF_PROCESSORS}"
& "$JOM" install
To build with VS 2017 or later in Command Prompt:
rem no quotes even if path contains spaces
set SRC_DIR=C:\src\redpanda-src
set BUILD_DIR=C:\src\redpanda-build
set INSTALL_DIR=C:\src\redpanda-pkg
set VCPKG_ROOT=C:\src\vcpkg
rem or x86-windows-static
set VCPKG_TARGET=x64-windows-static
rem check the version
set JOM=%VCPKG_ROOT%\downloads\tools\jom\jom-1.1.3\jom.exe
rem optional for clean build
rmdir /s /q "%BUILD_DIR%"
mkdir "%BUILD_DIR%" && cd /d "%BUILD_DIR%"
"%VCPKG_ROOT%\installed\%VCPKG_TARGET%\tools\qt5\bin\qmake.exe" PREFIX="%INSTALL_DIR%" "%SRC_DIR%\Red_Panda_CPP.pro"
"%JOM%" -j%NUMBER_OF_PROCESSORS%
"%JOM%" install
General steps:
qmake-based build steps:
qmake PREFIX=/usr/local /path/to/src/Red_Panda_CPP.pro
make -j$(nproc)
sudo make install
qmake variables:
PREFIX
: default to /usr/local
. It should be set to /usr
when packaging.LIBEXECDIR
: directory for auxiliary executables, default to $PREFIX/libexec
. Arch Linux uses /usr/lib
.LINUX_STATIC_IME_PLUGIN=ON
(make phase): link to static ime plugin. Recommended for building with static version of Qt; DO NOT set for dynamic version of Qt.xmake-based build steps:
xmake f -p linux -a x86_64 -m release --qt=/usr --prefix=/usr/local
xmake
sudo xmake install --root -o / # `-o ...` imitates `DESTDIR=...` in `make install`
Hint: xmake f --help
for more options.
sudo apt install \
build-essential debhelper \
libqt5svg5-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools
./packages/debian/builddeb.sh
sudo apt install /tmp/redpanda-cpp_*.deb
RedPandaIDE
Extra requirements for Windows host:
DOCKER=docker # or podman
SOURCE_DIR=/build/RedPanda-CPP # source directory *in container*
JOBS=$(nproc) # reduce it for multiple builds at same time
MIRROR=mirrors.kernel.org # leave empty for default mirror
PLATFORM=linux/amd64 # or linux/386, linux/arm64/v8, linux/arm/v7, linux/riscv64
IMAGE=debian:12 # or Ubuntu (e.g. ubuntu:22.04)
$DOCKER run --rm -e MIRROR=$MIRROR -e SOURCE_DIR=$SOURCE_DIR -e JOBS=$JOBS -v $PWD:$SOURCE_DIR --platform $PLATFORM $IMAGE $SOURCE_DIR/packages/debian/01-in-docker.sh
$DOCKER = "docker" # or "podman"
$SOURCE_DIR = "/build/RedPanda-CPP" # source directory *in container*
$JOBS = $Env:NUMBER_OF_PROCESSORS # reduce it for multiple builds at same time
$MIRROR = "mirrors.kernel.org" # leave empty for default mirror
$PLATFORM = "linux/amd64" # or "linux/386", "linux/arm64/v8", "linux/arm/v7", "linux/riscv64"
$IMAGE = "debian:12" # or Ubuntu (e.g. "ubuntu:22.04")
& $DOCKER run --rm -e MIRROR=$MIRROR -e SOURCE_DIR=$SOURCE_DIR -e JOBS=$JOBS -v "$(Get-Location):$SOURCE_DIR" --platform $PLATFORM $IMAGE $SOURCE_DIR/packages/debian/01-in-docker.sh
apt install gcc g++ make gdb gdbserver
apt install qtbase5-dev qttools5-dev-tools libqt5svg5-dev git qterminal
git clone https://github.com/royqh1979/RedPanda-CPP.git
cd RedPanda-CPP/
qmake Red_Panda_CPP.pro
make -j$(nproc)
sudo make install
RedPandaIDE
./packages/alpine/buildapk.sh
./packages/archlinux/buildpkg.sh
./packages/fedora/buildrpm.sh
./packages/opensuse/buildrpm.sh
~/packages/unsupported/$(uname -m)/redpanda-cpp-git-*.apk
/tmp/redpanda-cpp-git/redpanda-cpp-git-*.pkg.tar.zst
~/rpmbuild/RPMS/$(uname -m)/redpanda-cpp-git-*.rpm
RedPandaIDE
Note that these build scripts check out HEAD of the repo, so any changes should be committed before building.
Linux host:
ARCH=x86_64
podman run --rm -v $PWD:/mnt -w /mnt -e CARCH=$ARCH quay.io/redpanda-cpp/appimage-builder-$ARCH:20240304.0 packages/appimage/01-in-docker.sh
Windows host:
$ARCH = "x86_64"
podman run --rm -v "$(Get-Location):/mnt" -w /mnt -e CARCH=$ARCH redpanda-builder-$ARCH packages/appimage/01-in-docker.sh
Dockerfiles are available in redpanda-cpp/appimage-builder.
It is possible to build Red Panda C++ for foreign architectures using targets’ native toolchains with QEMU user space emulation.
Note: Always run emulated native build in containers or jails. Mixing architectures may kill your system.
For Linux or BSD host, install statically linked QEMU user space emulator (package name is likely qemu-user-static
) and make sure that binfmt support is enabled.
For Windows host, Docker and Podman should have QEMU user space emulation enabled. If not,
docker run --rm --privileged multiarch/qemu-user-static:register
wsl -d podman-machine-default sudo cp /usr/lib/binfmt.d/qemu-aarch64-static.conf /proc/sys/fs/binfmt_misc/register
wsl -d podman-machine-default sudo cp /usr/lib/binfmt.d/qemu-riscv64-static.conf /proc/sys/fs/binfmt_misc/register
Prerequisites:
xcode-select --install
Build:
SRC_DIR="~/redpanda-src"
BUILD_DIR="~/redpanda-build"
INSTALL_DIR="~/redpanda-pkg"
rm -rf "$BUILD_DIR" # optional for clean build
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
~/Qt/5.15.2/clang_64/bin/qmake PREFIX="$INSTALL_DIR" "$SRC_DIR/Red_Panda_CPP.pro"
make -j$(sysctl -n hw.logicalcpu)
make install
~/Qt/5.15.2/clang_64/bin/macdeployqt "$INSTALL_DIR/bin/RedPandaIDE.app"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。