Auf dieser Seite

Qt für das Qualcomm Snapdragon 8155P-Board unter Ubuntu kompilieren

Bevor Sie fortfahren, müssen die Entwicklungsumgebungen von Green Hills INTEGRITY und Qualcomm eingerichtet sein. Siehe „Installieren der plattformabhängigen Komponenten“.

Erstellen eines Shell-Skripts zum Einrichten der Umgebung

Um die Entwicklungsumgebung für Qt für INTEGRITY einzurichten, kompilieren Sie Qt aus den Quellcodes für das Qualcomm Snapdragon 8155P-Board. Bevor Sie Qt für INTEGRITY kompilieren, richten Sie die Kompilierungsumgebung ein. Hier finden Sie ein Batch-Skript zur Automatisierung dieses Vorgangs, da dieser vor jedem Kompilierungsvorgang durchgeführt werden muss.

Erstellen Sie ein neues Shell-Skript namens „setEnvironment.sh“ und speichern Sie es in Ihrem Home-Verzeichnis. Fügen Sie dem Skript die folgenden „export“-Befehle hinzu:

export PATH=$PATH:/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/comp
export INTEGRITY_DIR=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/integrity
export INTEGRITY_BSP=platform-sa8155
export INTEGRITY_BUILD_TARGET=chk
export QC_MULTIMEDIA_INC_DIR=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/include/amss/multimedia
export GL_INC_DIR=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/include/public
export GL_LIB_DIR=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/out/rel/libs/base:/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/out/rel/libs/multimedia/display:/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/out/rel/libs/multimedia/graphics:/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/out/rel/libs/platform/:/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/opengl/esx/build/integrity/prebuilt/

Diese Exportpfade setzen voraus, dass Sie bei der Installation der MULTI IDE und von INTEGRITY die Installationsverzeichnisse „ /work/ghs/* “ verwendet haben (siehe „Installation von Plattformabhängigkeiten“). Falls Sie nicht die Standardverzeichnisse verwendet haben, passen Sie die Exportpfade entsprechend an.

Um Ihre Build-Umgebung zu initialisieren, führen Sie den folgenden Befehl in einem Terminal aus:

source ~/setEnvironment.sh

Hinweis: Führen Sie diesen Befehl jedes Mal in Ihrem Terminalaus , wenn Sie Qt kompilieren oder die Build-Systeme „ qmake “ oder „ CMake “ verwenden.

Qt-Quellcode beziehen

Sie können den Qt-Quellcode über Ihr Qt-Konto herunterladen.

Sie können die Qt-Quellcodes auch aus dem Git-Repository beziehen, siehe „Quellcode beziehen“.

Hinweis: Die Version derQt -Quelldateien muss 6.2 oder höher sein.

Hinweis: Die von Qt for INTEGRITY unterstütztenQt-Module sind unter „Unterstützte Qt-Module“ aufgeführt.

Erstellen von Qt Desktop für die Verwendung mit Cross-Compiler-Tools

Für die Cross-Kompilierung von Qt muss eine Host-Version von Qt verfügbar sein. Während des Build-Vorgangs werden von dort aus Tools wie moc, rcc, qmlcachegen, qsb und andere aufgerufen. Weitere Informationen finden Sie unter „Cross-Kompilierung von Qt“.

Führen Sie die folgenden Befehle aus:

mkdir hostbuild
cd hostbuild/
../qt5/configure -nomake tests -nomake examples -release -prefix /work/ghs/hostbuild
cmake --build . --parallel 6
cmake --install .

Hinweis: „configure“ verwendet immer den Ninja-Generator und das Ninja-Build-Tool, sofern eine ausführbare Datei „ ninja “ verfügbar ist. Ninja ist plattformübergreifend, funktionsreich, leistungsstark und wird auf allen Plattformen empfohlen. Die Verwendung anderer Generatoren funktioniert möglicherweise, wird jedoch nicht offiziell unterstützt.

Erstellen einer Toolchain-Datei für INTEGRITY

Um ein Projekt mit CMake plattformübergreifend zu kompilieren, muss eine Toolchain-Datei angegeben werden. Diese CMake-Datei legt die richtigen Werte für den Plattformnamen, den verwendeten Compiler/Linker und eine ganze Reihe weiterer toolchain-spezifischer Einstellungen fest. Für den Integrity-Build unter Ubuntu erstellen Sie eine Datei „toolchain.cmake“ mit folgendem Inhalt:

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

set(TARGET_ROOT_PATH "/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot")
set(CMAKE_BUILD_TYPE "Release")

set(CMAKE_C_COMPILER cxintarm64)
set(CMAKE_CXX_COMPILER cxintarm64)
set(CMAKE_ASM_COMPILER cxintarm64)

#generic
set(CMAKE_SYSTEM_NAME Integrity)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING True)

set(EGL_FOUND True)
set(UNIX True)

set (CMAKE_C_COMPILE_FEATURES c_std_99)
set (CMAKE_CXX_COMPILE_FEATURES
cxx_alias_templates
cxx_alignas
cxx_alignof
cxx_attributes
cxx_auto_type
cxx_constexp
cxx_decltype
cxx_delegating_constructors
cxx_explicit_conversions
cxx_extern_templates
cxx_inheriting_constructors
cxx_lambdas
cxx_noexcept
cxx_nonstatic_member_init
cxx_nullptr
cxx_override
cxx_range_for
cxx_raw_string_literals
cxx_reference_qualified_functions
cxx_rvalue_references
cxx_static_assert
cxx_std_17
cxx_thread_local
cxx_unicode_literals
cxx_uniform_initialization
cxx_unrestricted_unions
cxx_variadic_macros
cxx_variadic_templates)

#graphical lib paths
set(EGL_LIBRARY_GRAPHIC_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/chk/libs/multimedia/graphics)
set(EGL_LIBRARY_PLATFORM_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/chk/libs/platform)
set(EGL_LIBRARY_BASE_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/chk/libs/base)
set(EGL_LIBRARY_CHK_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/integrity/libs/arm64/chk)
set(EGL_LIBRARY_PREBUILD_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/opengl/esx/build/integrity/prebuilt)
set(EGL_LIBRARY_OPENWFD_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/chk/libs/multimedia/display)

#base
set(CMAKE_C_FLAGS  "-bsp $ENV{INTEGRITY_BSP} -os_dir $ENV{INTEGRITY_DIR} -non_shared -startfile_dir=$ENV{INTEGRITY_DIR}/libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/arm64/$ENV{INTEGRITY_BUILD_TARGET} -bigswitch -DINTEGRITY -llibposix.a")
set(CMAKE_C_FLAGS_DEBUG "-g -Omaxdebug")
set(CMAKE_C_FLAGS_RELEASE "-Ospeed -Olink -Omax -no_uvfd")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --signed_fields --diag_suppress=1,82,228,236,381,611,961,997,1795,1931,1974,3148 --c++17 --thread_local_storage --exceptions --defer_parse_function_templates")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -frigor=accurate --signed_fields --no_implicit_include --link_once_templates -non_shared --new_outside_of_constructor --commons -I $ENV{QC_MULTIMEDIA_INC_DIR}")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBS OFF)
set(QT_CFLAGS_OPTIMIZE_FULL "-Ospeed -Olink -Omax -no_uvfd")
set(GLSLANG_OSDEP_PATH ../3rdparty/glslang/glslang/OSDependent/Unix)
set(GL_INC_DIR ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/include/public)
set(PKG_EGL_LIBRARY_DIRS ${TARGET_ROOT_PATH})

set(EGL_INCLUDE_DIR ${GL_INC_DIR})
set(EGL_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libESXEGL_Adreno.a")

set(GLESv2_INCLUDE_DIR ${GL_INC_DIR})
set(GLESv2_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libESXGLESv2_Adreno.a")

set(IntegrityPlatformGraphics_INCLUDE_DIR ${GL_INC_DIR})
set(IntegrityPlatformGraphics_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libadreno_utils.a")
set(IntegrityPlatformGraphics_LIBRARIES_PACK
    "${EGL_LIBRARY_BASE_PATH}/libplanedef.a"
    "${EGL_LIBRARY_BASE_PATH}/libmmosalfile.a"
    "${EGL_LIBRARY_BASE_PATH}/libOSAbstraction.a"
    "${EGL_LIBRARY_OPENWFD_PATH}/libopenwfd.a"
    "${EGL_LIBRARY_GRAPHIC_PATH}/libOSUser.a"
    "${EGL_LIBRARY_GRAPHIC_PATH}/libpanel.a"
    "${EGL_LIBRARY_GRAPHIC_PATH}/libGSLUser.a"
    "${EGL_LIBRARY_PREBUILD_PATH}/libglnext-llvm.a"
    "${EGL_LIBRARY_PLATFORM_PATH}/libpmem.a"
    "${EGL_LIBRARY_CHK_PATH}/libposix.a"
    "${EGL_LIBRARY_CHK_PATH}/libivfs.a"
)

list(APPEND _qt_igy_gui_libs
    "${GLESv2_LIBRARY}"
    "${IntegrityPlatformGraphics_LIBRARY}"
    "${IntegrityPlatformGraphics_LIBRARIES_PACK}")

set(OPENGL_INCLUDE_DIR ${GL_INC_DIR})
set(OPENGL_opengl_LIBRARY ${EGL_LIBRARY})

Konfiguration von Qt für INTEGRITY

Konfigurieren Sie Qt für das Qualcomm Snapdragon 8155P-Board mit den folgenden Befehlen:

cd /work/ghs/targetbuild // Path to Qt installation directory
cmake ../qt5/ -DQT_HOST_PATH=/work/ghs/hostbuild/qtbase
-DCMAKE_TOOLCHAIN_FILE=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/toolchain_integrity.cmake
-DQT_QMAKE_TARGET_MKSPEC=devices/integrity-armv8-SA8155P -DBUILD_qtdoc=OFF
-DBUILD_qttranslations=OFF -DFEATURE_printdialog=OFF --debug-trycompile -DFEATURE_dbus=OFF
-GNinja -DUNIX=ON
-DEGL_LIBRARY=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/libeglmegapack.a
-DEGL_INCLUDE_DIR=/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/include/public
-DFEATURE_dnslookup=OFF -DFEATURE_glib=OFF -DFEATURE_libudev=OFF -DFEATURE_system_pcre2=OFF -DFEATURE_sql_mysql=OFF
-DCMAKE_INSTALL_PREFIX=/work/ghs/targetbuild

Hinweis: INTEGRITY unterstützt ausschließlich statische Qt-Builds.

Hinweis: Die Variable„ QT_HOST_PATH “ wurde in Qt 6 eingeführt. Bei der Cross-Kompilierung muss diese auf den Installationspfad von Qt für die Host-Plattform gesetzt werden. Sie dient dazu, die auf dem Host auszuführenden Tools (moc, rcc, androiddeployqt usw.) zu finden.

Qt für INTEGRITY erstellen

Erstellen Sie Qt, indem Sie im Terminal den Befehl ` cmake ` aufrufen. Sie können ` cmake ` mit beliebig vielen Kernen auf Ihrem Host-Rechner ausführen. In unserem Beispiel verwenden wir sechs Kerne:

cmake --build . --parallel 6

Installation von Qt

Falls Sie die Konfigurationsoption „ -prefix $PWD/qtbase “ unter „Qt konfigurieren“ nicht verwendet haben, führen Sie die folgenden Befehle in einem Terminal aus:

cd <Qt installation directory>
cmake --install .

Wenn Sie die „configure“-Option „ -prefix $PWD/qtbase “ verwendet haben, können Sie Qt direkt aus dem Build-Verzeichnis nutzen, ohne den Befehl „ cmake install “ ausführen zu müssen.

Qt ist nun für das sa8155-Board konfiguriert und kompiliert.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.