From 0b3cdff2e32d6a9d5943e079a9452cdbdfbd6ff2 Mon Sep 17 00:00:00 2001 From: wanghao Date: Thu, 23 Nov 2023 11:33:19 +0800 Subject: [PATCH 1/2] [mod] up readme Signed-off-by: wanghao --- README.en.md | 23 ++--------------------- README.md | 23 ----------------------- linux_build.sh | 2 +- windows_build.bat | 2 +- 4 files changed, 4 insertions(+), 46 deletions(-) diff --git a/README.en.md b/README.en.md index 059726d7ae..c0f6da2380 100644 --- a/README.en.md +++ b/README.en.md @@ -40,25 +40,6 @@ OpenHarmony - Qt └───README.en.md - English readme ``` -# Compile Configuration Instructions +# Using Qt For OpenHarmony -## Linux -### Precondition -1. Complete cross-compilation based on Ubuntu20.04 amd64 version, download link: https://releases.ubuntu.com/focal/ubuntu-20.04.5-desktop-amd64.iso -2. Install Git tools (sudo apt-get install git) -3. Install Curl tools (sudo apt-get install curl) - -### Compilation Steps -1. Execute the linux_build.sh script to complete the qt5 source code, and code patch application, compilation and installation -2. After the script is executed, the installation directory is generated as the bin directory of the current folder - -## Windows -### Precondition -1. Install git, if installed skip, download link: https://gitforwindows.org/ -2. Install Perl, if installed skip, download link: https://strawberryperl.com/ -3. Install compilation tool if installed skip, reference linking:https://blog.csdn.net/orangebench11/article/details/126111356 -3. Set the running Path of the above installed program to the Path of the system environment. For example, set the path of ming32-make.exe to the path of the system environment - -### Compilation Steps -1. Execute the windows_build.bat script to complete the qt5 source code, and code patch application, compilation and installation -2. After the script is executed, the installation directory is generated as the bin directory of the current folder +See the repository wiki for instructions:https://gitee.com/openharmony-sig/qt/wikis diff --git a/README.md b/README.md index 4b5c218f92..187be8af48 100755 --- a/README.md +++ b/README.md @@ -40,29 +40,6 @@ OpenHarmony - Qt └───README.en.md - 英文版本readme ``` -# 编译配置说明 - -## Linux环境下 -### 前置条件 -1. 基于Ubuntu20.04 amd64版本完成交叉编译,下载链接:https://releases.ubuntu.com/focal/ubuntu-20.04.5-desktop-amd64.iso -2. 安装Git工具(sudo apt-get install git) -3. 安装Curl工具(sudo apt-get install curl) - -### 编译步骤 -1. 执行linux_build.sh脚本,完成qt5源码、代码补丁应用和编译安装 -2. 脚本执行完成后,生成安装目录为当前文件夹的bin目录 - -## Windows环境下 -### 前置条件 -1. 安装git, 如果已安装则跳过,下载链接:https://gitforwindows.org/ -2. 安装Perl,如果已安装则跳过,下载链接:https://strawberryperl.com/ -3. 安装编译工具, 如果已安装则跳过,参考链接:https://blog.csdn.net/orangebench11/article/details/126111356 -4. 将以上安装的程序运行路径设置到系统环境Path中,例:把ming32-make.exe的所在路径设置到系统环境Path中 - -### 编译步骤 -1. 执行windows_build.bat脚本,完成qt5源码、代码补丁应用和编译安装 -2. 脚本执行完成后,生成安装目录为当前文件夹的bin目录 - # Qt For OpenHarmony使用 参见仓库wiki说明:https://gitee.com/openharmony-sig/qt/wikis diff --git a/linux_build.sh b/linux_build.sh index 76918ff90c..baea78919d 100755 --- a/linux_build.sh +++ b/linux_build.sh @@ -176,7 +176,7 @@ function buildQtSrc() { $QT_SRC_DIR/configure -xplatform oh-clang -device-option OHOS_ARCH=$OHOS_ARCH -opensource -confirm-license -nomake tests -make examples -v \ -prefix $QT_INSTALL_DIR -skip doc -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel \ -skip qtgamepad -skip qtscript -opengl es2 -opengles3 -no-dbus -recheck-all - elif if [ "$3" == "9" ] + elif [ "$3" == "9" ] then $QT_SRC_DIR/configure -xplatform oh-clang -device-option OHOS_ARCH=$OHOS_ARCH -opensource -confirm-license -nomake tests -make examples -v \ -prefix $QT_INSTALL_DIR -skip doc -skip qtconnectivity -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel \ diff --git a/windows_build.bat b/windows_build.bat index fd9d1212d0..1b8c8bdce7 100644 --- a/windows_build.bat +++ b/windows_build.bat @@ -60,7 +60,7 @@ pause&exit /b :platform shift - set PLATFORM=%~1 + set OHOS_ARCH=%~1 goto nextarg :qtset shift -- Gitee From 25fa1735443f13ee89f3bd33946a5a9bd96c9605 Mon Sep 17 00:00:00 2001 From: wanghao Date: Thu, 23 Nov 2023 13:57:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[mod]=20=E5=88=A0=E9=99=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanghao --- linux_build.sh | 262 ------------------------------------------ windows_build.bat | 287 ---------------------------------------------- 2 files changed, 549 deletions(-) delete mode 100755 linux_build.sh delete mode 100644 windows_build.bat diff --git a/linux_build.sh b/linux_build.sh deleted file mode 100755 index baea78919d..0000000000 --- a/linux_build.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/bash -RED='\E[1;31m' -GREEN='\E[1;32m' -YELOW='\E[1;33m' -BLUE='\E[1;34m' -PINK='\E[1;35m' -RES='\E[0m' - -API9_SDK=http://download.ci.openharmony.cn/version/Master_Version/OpenHarmony_3.2.10.9/20230225_073754/version-Master_Version-OpenHarmony_3.2.10.9-20230225_073754-ohos-sdk-full.tar.gz -API10_SDK=http://download.ci.openharmony.cn/version/Master_Version/OpenHarmony_4.0.9.6/20230801_140933/version-Master_Version-OpenHarmony_4.0.9.6-20230801_140933-ohos-sdk-full_4.0-beta2.tar.gz - -function downloadQtSrc(){ - # Download qt5 source code - if [ ! -d $ROOT_DIR/QT_SRC_DIR ] - then - echo "Download qt5 source code ......" - git clone https://gitee.com/CplusCplus/qt5.git -b $1 --recursive $QT_SRC_DIR - else - echo "Update qt source code ......" - cd $QT_SRC_DIR - - git clean -fdx - git reset --hard - git submodule foreach --recursive git clean -fdx - git submodule update --init --recursive - git checkout $1 - - git pull origin $1 - git submodule sync - git submodule foreach --recursive git checkout $1 - git submodule foreach --recursive git pull origin $1 - cd $ROOT_DIR - fi -} - -function downloadOHSDK() { - OH_SDK=$1 - if [ -z "$OH_SDK" ];then - return - fi - - SUB_DIR=$(echo "$OH_SDK" | awk -F '/' '{print $6}') - SDK_PACKAGE=$(echo "$OH_SDK" | awk -F '/' '{print $8}') - echo "SDK_PACKAGE=${SDK_PACKAGE}" - - echo "Download OpenHarmony SDK......" - if [ ! -f $ROOT_DIR/$SDK_PACKAGE ] - then - curl -O $OH_SDK - else - echo "The $SDK_PACKAGE has already download." - fi - - if [ ! -d $ROOT_DIR/$SUB_DIR/ohos-sdk/linux ] - then - mkdir -p $ROOT_DIR/$SUB_DIR/ - tar -xzvf $SDK_PACKAGE -C $ROOT_DIR/$SUB_DIR/ - cd $ROOT_DIR/$SUB_DIR/ohos-sdk/linux - unzip -o $(ls | grep native-linux) - cd $ROOT_DIR - else - echo "SDK Package has alread unzip." - fi - - if [ ! -d $ROOT_DIR/$SUB_DIR/ohos-sdk/linux/native ] - then - cd $ROOT_DIR/$SUB_DIR/ohos-sdk/linux - unzip -o $(ls | grep native-linux) - cd $ROOT_DIR - fi - - export OHOS_SDK_PATH=$ROOT_DIR/$SUB_DIR/ohos-sdk/linux - echo "OHOS_SDK_PATH=$OHOS_SDK_PATH" - - export PATH=$ROOT_DIR/$SUB_DIR/ohos-sdk/linux/native/llvm/bin:$ROOT_DIR/$SUB_DIR/ohos-sdk/linux/native/llvm/lib:$PATH - echo "Append Compiler Path......$PATH" -} - -function downloadQtSrcPatch() { - echo "<------------------------------download qt5 for openharmony patch------------------------------>" - PATCH_DIR=$ROOT_DIR/OpenHarmony-qtpatch - if [ ! -d $PATCH_DIR ] - then - git clone https://gitee.com/openharmony-sig/qt.git $PATCH_DIR - else - cd $PATCH_DIR - git clean -fdx - git pull --rebase - cd $ROOT_DIR - fi - - echo "Apply QtBase Patch......" - cd $QT_SRC_DIR/qtbase - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtbase.patch - git apply --stat $PATCH_DIR/patch/$1/qtbase.patch - git apply $PATCH_DIR/patch/$1/qtbase.patch - cd $ROOT_DIR - - echo "Apply QtConnectivity Patch......" - cd $QT_SRC_DIR/qtconnectivity - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtconnectivity.patch - git apply --stat $PATCH_DIR/patch/$1/qtconnectivity.patch - git apply $PATCH_DIR/patch/$1/qtconnectivity.patch - cd $ROOT_DIR - - echo "Apply QtDeclarative Patch......" - cd $QT_SRC_DIR/qtdeclarative - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtdeclarative.patch - git apply --stat $PATCH_DIR/patch/$1/qtdeclarative.patch - git apply $PATCH_DIR/patch/$1/qtdeclarative.patch - cd $ROOT_DIR - - echo "Apply QtMultimedia Patch......" - cd $QT_SRC_DIR/qtmultimedia - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtmultimedia.patch - git apply --stat $PATCH_DIR/patch/$1/qtmultimedia.patch - git apply $PATCH_DIR/patch/$1/qtmultimedia.patch - cd $ROOT_DIR - - echo "Apply QtRemoteObjects Patch......" - cd $QT_SRC_DIR/qtremoteobjects - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtremoteobjects.patch - git apply --stat $PATCH_DIR/patch/$1/qtremoteobjects.patch - git apply $PATCH_DIR/patch/$1/qtremoteobjects.patch - cd $ROOT_DIR - - echo "Apply QtSensors Patch......" - cd $QT_SRC_DIR/qtsensors - git reset --hard - git clean -fdx - git apply --check $PATCH_DIR/patch/$1/qtsensors.patch - git apply --stat $PATCH_DIR/patch/$1/qtsensors.patch - git apply $PATCH_DIR/patch/$1/qtsensors.patch - cd $ROOT_DIR -} - -function buildQtSrc() { - OH_SDK_VERSION="$(echo $(echo "$1" | awk -F '/' '{print $6}') | awk -F '_' '{print $2}')" - BIN_DIR=$ROOT_DIR/qt_${2}_oh_sdk_${OH_SDK_VERSION}_bin/$2 - if [ "$OHOS_ARCH" == "arm64-v8a" ] - then - QT_INSTALL_DIR=$BIN_DIR/aarch64-linux-ohos - elif [ "$OHOS_ARCH" == "x86_64" ] - then - QT_INSTALL_DIR=$BIN_DIR/x86_64-linux-ohos - else - QT_INSTALL_DIR=$BIN_DIR/arm-linux-ohos - fi - echo "QT_INSTALL_DIR=$QT_INSTALL_DIR" - - - echo "Build Qt......" - echo "openharmony sdk version:$OH_SDK_VERSION" - echo "INSTALL path:$QT_INSTALL_DIR" - - BUILD_DIR="$ROOT_DIR/build_qt_${QT_VERSION}_oh_sdk_$OH_SDK_VERSION" - if [ ! -d $BUILD_DIR ] - then - mkdir -p $BUILD_DIR - fi - - chmod +x $QT_SRC_DIR -R - cd $BUILD_DIR - if [ "$3" == "10" ]; - then - $QT_SRC_DIR/configure -xplatform oh-clang -device-option OHOS_ARCH=$OHOS_ARCH -opensource -confirm-license -nomake tests -make examples -v \ - -prefix $QT_INSTALL_DIR -skip doc -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel \ - -skip qtgamepad -skip qtscript -opengl es2 -opengles3 -no-dbus -recheck-all - elif [ "$3" == "9" ] - then - $QT_SRC_DIR/configure -xplatform oh-clang -device-option OHOS_ARCH=$OHOS_ARCH -opensource -confirm-license -nomake tests -make examples -v \ - -prefix $QT_INSTALL_DIR -skip doc -skip qtconnectivity -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel \ - -skip qtgamepad -skip qtscript -opengl es2 -opengles3 -no-dbus -recheck-all - fi - - make -j16 - make install -} - -usage="$(basename "$0") [-h] [-p platform] [-v 10]-- build Qt For OpenHarmony - -where: - -h show help information - -q specifying the qt version,support v5.15.11 and v5.12.12(default) - -v openharmony sdk version, support 9 and 10(default 10) - -p set target platform(default arm64-v8a) - arm64-v8a - platform for arm64-v8a - armeabi-v7a - platform for armeabi-v7a - x86_64 - platform for x86_64" - -export OHOS_ARCH=arm64-v8a -export OHOS_SDK_V=9 -export QT_VERSION=v5.12.12 -while getopts 'hp:v:q:' option; do - case "$option" in - h) - echo "$usage" - exit - ;; - p) - export OHOS_ARCH=$OPTARG - if [ "$OHOS_ARCH" != "armeabi-v7a" ] && [ "$OHOS_ARCH" != "arm64-v8a" ] && [ "$OHOS_ARCH" != "x86_64" ]; then - echo "no valid platform value set." - echo "$usage" - exit 1 - fi - ;; - v) - export OHOS_SDK_V=$OPTARG - if [ "$OHOS_SDK_V" != "9" ] && [ "$OHOS_SDK_V" != "10" ]; then - echo "no valid platform value set." - echo "$usage" - exit 1 - fi - ;; - q) - export QT_VERSION=$OPTARG - if [ "$QT_VERSION" != "v5.12.12" ] && [ "$QT_VERSION" != "v5.15.11" ]; then - echo "unsupported versions." - echo "$usage" - exit 1 - fi - ;; - :) - printf "missing argument for -%s\n" "$OPTARG" >&2 - echo "$usage" >&2 - exit 1 - ;; - ?) - printf "illegal option: -%s\n" "$OPTARG" >&2 - echo "$usage" >&2 - exit 1 - ;; - esac -done - -echo "OHOS_ARCH=$OHOS_ARCH" -echo "OHOS_SDK_V=$OHOS_SDK_V" - -ROOT_DIR=$(cd `dirname $0`;pwd) -echo "ROOT_DIR=${ROOT_DIR}" -export QT_SRC_DIR=$ROOT_DIR/${QT_VERSION}_SRC -downloadQtSrc $QT_VERSION -downloadQtSrcPatch $QT_VERSION -TARGET_VERSION=API${OHOS_SDK_V}_SDK -eval TARGET_VERSION=$(echo \$$TARGET_VERSION) - -downloadOHSDK $TARGET_VERSION -buildQtSrc $TARGET_VERSION $QT_VERSION $OHOS_SDK_V - -echo -e "${GREEN}Press any key to continue...... ${RES}" -read -n 1 diff --git a/windows_build.bat b/windows_build.bat deleted file mode 100644 index 1b8c8bdce7..0000000000 --- a/windows_build.bat +++ /dev/null @@ -1,287 +0,0 @@ -@echo off -set "e=|| exit /b 1" -set ROOT_DIR=%cd% -set PATH=%PATH%;%cd%; -set API9_SDK=http://download.ci.openharmony.cn/version/Master_Version/OpenHarmony_3.2.10.9/20230225_073754/version-Master_Version-OpenHarmony_3.2.10.9-20230225_073754-ohos-sdk-full.tar.gz -set API10_SDK=http://download.ci.openharmony.cn/version/Master_Version/OpenHarmony_4.0.10.5/20230824_120941/version-Master_Version-OpenHarmony_4.0.10.5-20230824_120941-ohos-sdk-full_monthly.tar.gz - -set ARGS=%* -set QT_VERSION=v5.12.12 -set OHOS_ARCH=arm64-v8a -set API_VERSION=10 -set TARGET_API=%API10_SDK% -set QT_SRC_DIR=%ROOT_DIR%\%QT_VERSION%_SRC -goto :doargs %ARGS% -REM goto doneargs - -:doneargs -call :acquireUnzip -call :acquireQtSrc -call :acquirePatch -echo %TARGET_API% - -if not "%TARGET_API%" == "" ( - call :acquireOHSDK %TARGET_API% - call :buildQt -) else ( - echo "need to configure sdk" - exit /b -) - -pause&exit /b - -:doargs - if "%~1" == "" goto doneargs - if "%~1" == "-?" goto help - if /i "%~1" == "/h" goto help - if /i "%~1" == "-h" goto help - if /i "%~1" == "/help" goto help - if /i "%~1" == "-help" goto help - if /i "%~1" == "--help" goto help - if /i "%~1" == "-qt" goto qtset - if /i "%~1" == "-api" goto apiset - - if /i "%~1" == "-platform" goto platform - if /i "%~1" == "--platform" goto platform - -:nextarg - shift - goto doargs - -:help - echo -h show help information - echo -qt specifying the qt version,support v5.15.11 and v5.12.12(default) - echo -api build qt with openharmony api, support 9 and 10(default 10) - echo -platform set target platform(default arm64-v8a) - echo arm64-v8a - platform for arm64-v8a - echo armeabi-v7a - platform for armeabi-v7a - echo x86_64 - platform for x86_64 - exit /b 1 - -:platform - shift - set OHOS_ARCH=%~1 - goto nextarg -:qtset - shift - set QT_VERSION=%~1 - set QT_SRC_DIR=%ROOT_DIR%\%QT_VERSION%_SRC - goto nextarg - -:apiset - shift - set API_VERSION=%~1 - call set TARGET_API=%%API%API_VERSION%_SDK%% - goto nextarg - -:acquireQtSrc -REM <------------------------------download qt5 source------------------------------> -echo %QT_SRC_DIR% -if not exist "%QT_SRC_DIR%" ( - echo "Download %QT_VERSION% source code ....." - git clone https://gitee.com/CplusCplus/qt5.git -b %QT_VERSION% --recursive %QT_SRC_DIR% - REM cd %QT_SRC_DIR% - REM git submodule update --init --recursive - REM git checkout origin %QT_VERSION% - REM cd %ROOT_DIR% -) else ( - echo "Update qt source code ......" - cd %QT_SRC_DIR% - - git clean -fdx - git reset --hard - git submodule foreach --recursive git clean -fdx - git submodule update --init --recursive - git checkout %QT_VERSION% - - git pull origin %QT_VERSION% - git submodule sync - git submodule foreach --recursive git checkout %QT_VERSION% - git submodule foreach --recursive git pull origin %QT_VERSION% - cd %ROOT_DIR% -) -goto :eof - -:acquireUnzip -REM <------------------------------download unzip.exe------------------------------> -echo "Download Unzip.exe........." -if not exist "%ROOT_DIR%\unzip.exe" ( - curl -O http://stahlworks.com/dev/unzip.exe -) -goto :eof - -:acquireOHSDK -REM <------------------------------download openharmony sdk------------------------------> -set SDK_PACKAGE=%~nx1 -echo "Download OpenHarmony SDK........." -if exist "%ROOT_DIR%\%SDK_PACKAGE%" ( - echo "The %SDK_PACKAGE% has already download." -) else ( - curl -O %~1 -) - -set UN_ZIP_DIR=""; -for /f "tokens=3 delims=-" %%a in ("%SDK_PACKAGE%") do ( - set UN_ZIP_DIR=%%a -) - -if "%UN_ZIP_DIR%" == "" ( - echo "sdk unzip dir is empty"; - exit /b -) -echo "unzip ohos sdk dir:%UN_ZIP_DIR%" - -REM Qt编译时使用了OHOS_SDK_VERSION -set OHOS_SDK_VERSION="" -for /f "tokens=2 delims=_" %%i in ("%UN_ZIP_DIR%") do ( - set OHOS_SDK_VERSION=%%i -) - -REM <------------------------------uncompress openharmony sdk------------------------------> -if not exist "%ROOT_DIR%\%UN_ZIP_DIR%" ( - mkdir %ROOT_DIR%\%UN_ZIP_DIR% - tar -xzvf %SDK_PACKAGE% -C %ROOT_DIR%\%UN_ZIP_DIR% - cd %ROOT_DIR% -) else ( - echo "SDK package has already unzip." -) - -if not exist "%ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk" ( - mkdir %ROOT_DIR%\%UN_ZIP_DIR% - tar -xzvf %SDK_PACKAGE% -C %ROOT_DIR%\%UN_ZIP_DIR% - cd %ROOT_DIR% -) else ( - echo "SDK package has already unzip." -) - -for /f "delims=" %%a in ('dir %ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk\windows^|findstr native-windows') do ( - for /f "tokens=4" %%i in ("%%a") do ( - set nativefile=%%i - ) -) -echo "native file:%nativefile%" - -if not exist "%ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk\windows\native" ( - cd %ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk\windows - unzip -o -d %ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk\windows %nativefile% - cd %ROOT_DIR% -) else ( - echo "SDK package has already unzip." -) - -set OHOS_SDK_PATH=%ROOT_DIR%\%UN_ZIP_DIR%\ohos-sdk\windows -set LLVM_INSTALL_DIR=%OHOS_SDK_PATH%\native\llvm -set PATH=%PATH%;%OHOS_SDK_PATH%\native\llvm\bin;%OHOS_SDK_PATH%\native\llvm\lib;%OHOS_SDK_PATH%\native\llvm\include; -echo "OHOS_SDK_PATH:%OHOS_SDK_PATH%" -goto :eof - -:acquirePatch -REM <------------------------------download qt5 for openharmony patch------------------------------> -set PATCH_DIR=%ROOT_DIR%\OpenHarmony-qtpatch -if not exist "%PATCH_DIR%" ( - git clone https://gitee.com/openharmony-sig/qt.git %PATCH_DIR% -) else ( - - cd %PATCH_DIR% - git clean -fdx - git pull --rebase - cd %ROOT_DIR% -) - -REM <------------------------------apply git patch to the qt5 source------------------------------> -echo "Apply QtBase Patch......" -cd %QT_SRC_DIR%/qtbase - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtbase.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtbase.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtbase.patch -cd %ROOT_DIR% - -echo "Apply QtConnectivity Patch......" -cd %QT_SRC_DIR%/qtconnectivity - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtconnectivity.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtconnectivity.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtconnectivity.patch -cd %ROOT_DIR% - -echo "Apply QtDeclarative Patch......" -cd %QT_SRC_DIR%/qtdeclarative - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtdeclarative.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtdeclarative.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtdeclarative.patch -cd %ROOT_DIR% - -echo "Apply QtMultimedia Patch......" -cd %QT_SRC_DIR%/qtmultimedia - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtmultimedia.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtmultimedia.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtmultimedia.patch -cd %ROOT_DIR% - - -echo "Apply QtRemoteObjects Patch......" -cd %QT_SRC_DIR%/qtremoteobjects - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtremoteobjects.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtremoteobjects.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtremoteobjects.patch -cd %ROOT_DIR% - -echo "Apply QtSensors Patch......" -cd %QT_SRC_DIR%/qtsensors - git reset --hard - git clean -fdx - git apply --check %PATCH_DIR%/patch/%QT_VERSION%/qtsensors.patch - git apply --stat %PATCH_DIR%/patch/%QT_VERSION%/qtsensors.patch - git apply %PATCH_DIR%/patch/%QT_VERSION%/qtsensors.patch -cd %ROOT_DIR% - -goto :eof - -:buildQt -echo "<---------------buildQt------------------>" -if "%OHOS_ARCH%" == "arm64-v8a" ( - set OHOS_TARGET=aarch64-windows-ohos -) else if "%OHOS_ARCH%" == "x86_64" ( - set OHOS_TARGET=x86_64-windows-ohos -) else ( - set OHOS_ARCH=armeabi-v7a - set OHOS_TARGET=arm-windows-ohos -) - -echo "Build Qt for OpenHarmony with %OHOS_ARCH%" -set QT_INSTALL_DIR=%ROOT_DIR%\qt_%QT_VERSION%_oh_sdk_%OHOS_SDK_VERSION%_bin\%QT_VERSION%\%OHOS_TARGET% -echo %QT_INSTALL_DIR% - -set BUILD_DIR=%ROOT_DIR%\build_qt_%QT_VERSION%_oh_sdk_%OHOS_SDK_VERSION%\%OHOS_TARGET% -if not exist "%BUILD_DIR%" ( - mkdir %BUILD_DIR% -) -echo "BUILD_DIR:%BUILD_DIR%" -echo "API_VERSION:%API_VERSION%" -cd %BUILD_DIR% -REM api 9 does not support the bluetooth module -if "%API_VERSION%" == "10" ( - call %QT_SRC_DIR%\configure.bat -platform win32-g++ -xplatform oh-clang -device-option OHOS_ARCH=%OHOS_ARCH% -opensource -confirm-license -nomake tests -make examples -v ^ - -prefix %QT_INSTALL_DIR% -skip doc -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel -skip qtgamepad -skip qtscript -opengl es2 ^ - -opengles3 -no-dbus -recheck-all -) else ( - call %QT_SRC_DIR%\configure.bat -platform win32-g++ -xplatform oh-clang -device-option OHOS_ARCH=%OHOS_ARCH% -opensource -confirm-license -nomake tests -make examples -v ^ - -prefix %QT_INSTALL_DIR% -skip doc -skip qtconnectivity -skip qtvirtualkeyboard -skip qtnetworkauth -skip qtwebengine -skip qtlocation -skip qtwebchannel -skip qtgamepad -skip qtscript -opengl es2 ^ - -opengles3 -no-dbus -recheck-all -) - - -mingw32-make -j16 -mingw32-make install - -cd %ROOT_DIR% -goto :eof \ No newline at end of file -- Gitee