diff --git a/.github/actions/qt-android/action.yml b/.github/actions/qt-android/action.yml index c932454e5a7..9bc90bf3325 100644 --- a/.github/actions/qt-android/action.yml +++ b/.github/actions/qt-android/action.yml @@ -4,6 +4,9 @@ inputs: host: description: Host required: true + arch: + description: Arch + required: true version: description: Qt Version required: false @@ -28,10 +31,6 @@ runs: packages: 'platform-tools platforms;android-34 build-tools;34.0.0' # ndk;25.1.8937393' log-accepted-android-sdk-licenses: false - - name: Update Android SDK / NDK / Tools - run: sdkmanager --update - shell: bash - - name: Install Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk @@ -45,10 +44,15 @@ runs: echo "ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV" shell: bash + - name: Update Android SDK / NDK / Tools + if: ${{ runner.os != 'Windows' }} + run: sdkmanager --update + shell: bash + - name: Set Up Cache uses: hendrikmuhs/ccache-action@v1.2 with: - create-symlink: true + create-symlink: ${{ runner.os != 'Windows' }} key: ${{ runner.os }}-Android-${{ matrix.BuildType }} restore-keys: ${{ runner.os }}-Android-${{ matrix.BuildType }} max-size: 1G @@ -62,6 +66,7 @@ runs: aqtversion: ==3.1.* host: ${{ inputs.host }} target: desktop + arch: ${{ inputs.arch }} dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} diff --git a/.github/workflows/android-linux.yml b/.github/workflows/android-linux.yml index 45779c44b9b..6ee800330fc 100644 --- a/.github/workflows/android-linux.yml +++ b/.github/workflows/android-linux.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] defaults: run: @@ -68,6 +68,7 @@ jobs: uses: ./.github/actions/qt-android with: host: linux + arch: gcc_64 version: ${{ env.QT_VERSION }} abis: ${{ env.QT_ANDROID_ABIS }} diff --git a/.github/workflows/android-macos.yml b/.github/workflows/android-macos.yml index 7b2f10998bf..6bccb36f624 100644 --- a/.github/workflows/android-macos.yml +++ b/.github/workflows/android-macos.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] defaults: run: @@ -23,7 +23,7 @@ jobs: QT_ANDROID_KEYSTORE_ALIAS: QGCAndroidKeyStore QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - QT_ANDROID_ABIS: "armeabi-v7a;arm64-v8a" + QT_ANDROID_ABIS: ${{ matrix.BuildType == 'Release' && 'armeabi-v7a;arm64-v8a' || 'arm64-v8a' }} steps: - name: Checkout repo @@ -44,6 +44,7 @@ jobs: uses: ./.github/actions/qt-android with: host: mac + arch: clang_64 version: ${{ env.QT_VERSION }} abis: ${{ env.QT_ANDROID_ABIS }} @@ -55,7 +56,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }} -DQT_ANDROID_ABIS="${{ env.QT_ANDROID_ABIS }}" -DQT_ANDROID_BUILD_ALL_ABIS=OFF - -DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../msvc2019_64" + -DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../macos" -DQT_ANDROID_SIGN_APK=${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && 'ON' || 'OFF' }} -DQT_DEBUG_FIND_PACKAGE=ON -DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }} diff --git a/.github/workflows/android-windows.yml b/.github/workflows/android-windows.yml index efb48dd49fb..43a46527f4c 100644 --- a/.github/workflows/android-windows.yml +++ b/.github/workflows/android-windows.yml @@ -1,7 +1,23 @@ name: Android-Windows on: - workflow_dispatch: + push: + branches: + - master + - 'Stable*' + tags: + - 'v*' + paths-ignore: + - 'deploy/**' + - 'docs/**' + pull_request: + paths-ignore: + - 'deploy/**' + - 'docs/**' + - '.github/workflows/docs_deploy.yml' + - '.github/workflows/linux.yml' + - '.github/workflows/macos.yml' + - '.github/workflows/windows.yml' jobs: build: @@ -9,7 +25,7 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] defaults: run: @@ -23,7 +39,7 @@ jobs: QT_ANDROID_KEYSTORE_ALIAS: QGCAndroidKeyStore QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - QT_ANDROID_ABIS: "armeabi-v7a;arm64-v8a" + QT_ANDROID_ABIS: ${{ matrix.BuildType == 'Release' && 'armeabi-v7a;arm64-v8a' || 'arm64-v8a' }} steps: - name: Checkout repo @@ -47,6 +63,7 @@ jobs: uses: ./.github/actions/qt-android with: host: windows + arch: win64_msvc2019_64 version: ${{ env.QT_VERSION }} abis: ${{ env.QT_ANDROID_ABIS }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ae416db7b29..011650ebd58 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,7 +1,25 @@ name: Docker on: - workflow_dispatch: + push: + branches: + - master + - 'Stable*' + tags: + - 'v*' + paths-ignore: + - 'android/**' + - 'deploy/**' + - 'docs/**' + pull_request: + paths-ignore: + - 'android/**' + - 'deploy/**' + - 'docs/**' + - '.github/workflows/docs_deploy.yml' + - '.github/workflows/android.yml' + - '.github/workflows/macos.yml' + - '.github/workflows/windows.yml' jobs: build: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index c42d6866bce..b0f4f0d7f32 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] defaults: run: @@ -21,6 +21,20 @@ jobs: GST_VERSION: 1.22.12 steps: + - name: Recover disk space + run: | + df -h + ls /Applications + brew uninstall google-chrome + sudo rm -rf /Users/runner/Library/Android + sudo rm -rf /Applications/Xcode_14* + sudo rm -rf /Applications/Xcode_15.0* + sudo rm -rf /Applications/Xcode_15.1* + sudo rm -rf /Applications/Xcode_15.2* + sudo rm -rf /Applications/Xcode_15.3* + ls /Applications + df -h + - name: Checkout repo uses: actions/checkout@v4 with: @@ -28,6 +42,11 @@ jobs: fetch-tags: true fetch-depth: 0 + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: seanmiddleditch/gha-setup-ninja@v5 - name: Install Dependencies @@ -38,8 +57,8 @@ jobs: - name: Set Up Cache uses: hendrikmuhs/ccache-action@v1.2 with: - key: ${{ runner.os }}-${{ matrix.BuildType }} - restore-keys: ${{ runner.os }}-${{ matrix.BuildType }} + key: ${{ runner.os }}-iOS-${{ matrix.BuildType }} + restore-keys: ${{ runner.os }}-iOS-${{ matrix.BuildType }} max-size: 1G append-timestamp: false save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} @@ -51,6 +70,7 @@ jobs: aqtversion: ==3.1.* host: mac target: desktop + arch: clang_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} @@ -62,12 +82,13 @@ jobs: aqtversion: ==3.1.* host: mac target: ios + arch: ios dir: ${{ runner.temp }} extra: --autodesktop modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - - run: mkdir ${{ runner.temp }}/shadow_build_dir + - run: mkdir ${{ runner.temp }}/shadow_build_dir - name: Configure working-directory: ${{ runner.temp }}/shadow_build_dir diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2ccaeec3684..21406644a03 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -29,15 +29,15 @@ jobs: matrix: BuildType: [Debug, Release] + defaults: + run: + shell: bash + env: ARTIFACT: QGroundControl-x86_64.AppImage QT_VERSION: 6.6.3 # GST_VERSION: 1.22.12 - defaults: - run: - shell: bash - steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -98,6 +98,7 @@ jobs: aqtversion: ==3.1.* host: linux target: desktop + arch: gcc_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d71900e6134..380e460ff0a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -27,17 +27,17 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] + + defaults: + run: + shell: bash env: ARTIFACT: QGroundControl.dmg QT_VERSION: 6.6.3 GST_VERSION: 1.22.12 - defaults: - run: - shell: bash - steps: - name: Checkout repo uses: actions/checkout@v4 @@ -46,6 +46,11 @@ jobs: fetch-tags: true fetch-depth: 0 + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: seanmiddleditch/gha-setup-ninja@v5 - name: Install Dependencies @@ -78,6 +83,7 @@ jobs: aqtversion: ==3.1.* host: mac target: desktop + arch: clang_64 dir: ${{ runner.temp }} modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors cache: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8daac794f85..dc1629e323f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - BuildType: [Debug, Release] + BuildType: [Release] Arch: [x64] # Arm64 defaults: @@ -105,7 +105,7 @@ jobs: aqtversion: ==3.1.* host: windows target: desktop - arch: win64_msvc2019_64 + arch: win64_msvc2019_arm64 dir: ${{ runner.temp }} extra: --autodesktop modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors diff --git a/CMakeLists.txt b/CMakeLists.txt index 491fb33a9b3..7f494abef95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR OFF) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release") if(NOT CMAKE_BUILD_TYPE) @@ -361,9 +363,27 @@ elseif(MACOS) ) elseif(IOS) enable_language(OBJC) + + set(CMAKE_OSX_ARCHITECTURES "arm64") + set(CMAKE_OSX_SYSROOT "iphoneos") + set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0") + set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "14.0") + set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iPhone,iPad + set(CMAKE_XCODE_ATTRIBUTE_INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/deploy/ios/iOS-Info.plist") + set_target_properties(${PROJECT_NAME} PROPERTIES QT_IOS_LAUNCH_SCREEN ${CMAKE_SOURCE_DIR}/deploy/ios/QGCLaunchScreen.xib + XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.mavlink.qgroundcontrol" + XCODE_ATTRIBUTE_PRODUCT_NAME ${CMAKE_PROJECT_NAME} + XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${CMAKE_PROJECT_VERSION} + XCODE_ATTRIBUTE_MARKETING_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon" + XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "14.0" + XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" # iPhone,iPad + XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName ${CMAKE_PROJECT_NAME} + XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.mycategory" + XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES" ) elseif(ANDROID) FetchContent_Declare(android_openssl diff --git a/src/Comms/LinkManager.cc b/src/Comms/LinkManager.cc index 85b8533fc1a..6fd410bfd42 100644 --- a/src/Comms/LinkManager.cc +++ b/src/Comms/LinkManager.cc @@ -71,7 +71,9 @@ LinkManager::LinkManager(QGCApplication* app, QGCToolbox* toolbox) qRegisterMetaType(); qRegisterMetaType("LinkInterface*"); +#ifndef NO_SERIAL_LINK qRegisterMetaType("QGCSerialPortInfo"); +#endif } LinkManager::~LinkManager() diff --git a/src/Joystick/JoystickManager.cc b/src/Joystick/JoystickManager.cc index 717ae4e93f8..fa942a98ec2 100644 --- a/src/Joystick/JoystickManager.cc +++ b/src/Joystick/JoystickManager.cc @@ -11,9 +11,8 @@ #include "JoystickManager.h" #include "MultiVehicleManager.h" #include "Joystick.h" -#if !defined(__mobile__) || defined(QGC_SDL_JOYSTICK) +#if defined(QGC_SDL_JOYSTICK) #include "JoystickSDL.h" - #define __sdljoystick__ #elif defined(Q_OS_ANDROID) #include "JoystickAndroid.h" #endif @@ -57,7 +56,7 @@ void JoystickManager::setToolbox(QGCToolbox *toolbox) } void JoystickManager::init() { -#ifdef __sdljoystick__ +#ifdef QGC_SDL_JOYSTICK if (!JoystickSDL::init()) { return; } @@ -77,7 +76,7 @@ void JoystickManager::_setActiveJoystickFromSettings(void) { QMap newMap; -#ifdef __sdljoystick__ +#ifdef QGC_SDL_JOYSTICK // Get the latest joystick mapping newMap = JoystickSDL::discover(_multiVehicleManager); #elif defined(Q_OS_ANDROID) @@ -194,7 +193,7 @@ bool JoystickManager::setActiveJoystickName(const QString& name) */ void JoystickManager::_updateAvailableJoysticks() { -#ifdef __sdljoystick__ +#ifdef QGC_SDL_JOYSTICK SDL_Event event; while (SDL_PollEvent(&event)) { switch(event.type) {