Skip to content

泰山派_交叉编译qt

构建makefile

使用虚拟机直接编译,用vscode remote容易崩

在qt源码的根目录下新建 auto-configure.sh

shell
#!/bin/sh
./configure \
-prefix /home/shelton/Workspaces/source/qt/build/aarch64-rk3566-linux-gnu-qt-5.15.2 \
-xplatform aarch64-rk3566-linux-gnu-g++ \
-confirm-license \
-opensource \
-release \
-make libs \
-pch \
-qt-libjpeg \
-qt-libpng \
-qt-zlib \
-no-opengl \
-no-sse2 \
-no-openssl \
-no-cups \
-no-glib \
-no-dbus \
-no-separate-debug-info \
-nomake tools \
-nomake examples \
-qpa linuxfb \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtspeech \
-skip qtsvg \
-skip qttools \
-skip qttranslations \
-skip qtwayland \
-skip qtwebengine \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-skip qtdeclarative \
-skip qtmultimedia

创建交叉编译平台 qt-everywhere-src-5.12.9/qtbase/mkspecs/aarch64-rk3566-linux-gnu-g++

qmake.conf

#
# qmake configuration for building with aarch64-buildroot-linux-gnu-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS_RELEASE += -O2 -march=armv8-a -lts
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv8-a -lts

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = aarch64-buildroot-linux-gnu-gcc
QMAKE_CXX               = aarch64-buildroot-linux-gnu-g++
QMAKE_LINK              = aarch64-buildroot-linux-gnu-g++
QMAKE_LINK_SHLIB        = aarch64-buildroot-linux-gnu-g++

# modifications to linux.conf
QMAKE_AR                = aarch64-buildroot-linux-gnu-ar cqs
QMAKE_OBJCOPY           = aarch64-buildroot-linux-gnu-objcopy
QMAKE_NM                = aarch64-buildroot-linux-gnu-nm -P
QMAKE_STRIP             = aarch64-buildroot-linux-gnu-strip
load(qt_config)

执行这个脚本,构建makefile

e -j16` 开始编译

make install 安装

#_Now 把画面在rk3566上跑起来

最近更新