Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Link Test Libs Privately #12413

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
cpm-modules:
description: Path to CPM Modules
required: false
default: $GITHUB_WORKSPACE/cpm-modules
default: $RUNNER_TEMP/shadow_build_dir/cpm-modules
ccache-version:
description: ccache Version to Install
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_ABIS: ${{ matrix.BuildType == 'Release' && 'armeabi-v7a;arm64-v8a' || 'arm64-v8a' }}
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}/shadow_build_dir/cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_ABIS: 'arm64-v8a'
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}/shadow_build_dir/cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_ABIS: 'arm64-v8a'
CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}\shadow_build_dir\cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
ARTIFACT: QGroundControl-installer.exe
QT_VERSION: 6.8.1
GST_VERSION: 1.22.12
CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}\shadow_build_dir\cpm_modules

steps:
- name: Checkout repo
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:
- 'v*'
paths:
- 'docs/**'
- 'package*.json'
pull_request:
paths:
- 'docs/**'

- 'package*.json'
workflow_dispatch:

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
PACKAGE: QGroundControl
QT_VERSION: 6.8.1
GST_VERSION: 1.22.12
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}/shadow_build_dir/cpm_modules

steps:
- name: Checkout repo
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/linux.yml'
- 'deploy/linux/**'
- 'src/**'
- 'test/**'
- 'CMakeLists.txt'

# concurrency:
Expand All @@ -36,7 +37,7 @@ jobs:
PACKAGE: QGroundControl-x86_64
QT_VERSION: 6.8.1
GST_VERSION: 1.22.12
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}/shadow_build_dir/cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
ARTIFACT: QGroundControl.dmg
PACKAGE: QGroundControl
QT_VERSION: 6.8.1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}/shadow_build_dir/cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
PACKAGE: QGroundControl-installer
QT_VERSION: 6.8.1
GST_VERSION: 1.22.12
CPM_SOURCE_CACHE: ${{ github.workspace }}\cpm_modules
CPM_SOURCE_CACHE: ${{ runner.temp }}\shadow_build_dir\cpm_modules

steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion test/AutoPilotPlugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ target_link_libraries(AutoPilotPluginsTest
Qt6::Test
APMAutoPilotPlugin
AutoPilotPlugins
CommonAutoPilotPlugin
PX4AutoPilotPlugin
Vehicle
PUBLIC
Qt6::Core
CommonAutoPilotPlugin
qgcunittest
)

Expand Down
2 changes: 1 addition & 1 deletion test/Geo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ qt_add_library(GeoTest

target_link_libraries(GeoTest
PRIVATE
Qt6::Positioning
Qt6::Test
Geo
PUBLIC
Qt6::Positioning
qgcunittest
)

Expand Down
9 changes: 5 additions & 4 deletions test/MissionManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ qt_add_library(MissionManagerTest

target_link_libraries(MissionManagerTest
PRIVATE
Qt6::Positioning
Qt6::Test
API
FactSystem
FirmwarePlugin
MissionManager
QmlControls
Settings
TerrainTest
Utilities
Vehicle
TerrainTest
PUBLIC
Qt6::Positioning
MissionManager
qgcunittest
QmlControls
)

target_include_directories(MissionManagerTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
1 change: 1 addition & 0 deletions test/MissionManager/MissionItemTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "MissionItemTest.h"
#include "SimpleMissionItem.h"
#include "PlanMasterController.h"
#include "MissionItem.h"
#include "MultiSignalSpy.h"

#include <QtTest/QTest>
Expand Down
2 changes: 1 addition & 1 deletion test/MissionManager/MissionItemTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#pragma once

#include "UnitTest.h"
#include "MissionItem.h"

class MissionItem;
class PlanMasterController;

/// Unit test for the MissionItem Object
Expand Down
4 changes: 2 additions & 2 deletions test/Terrain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ qt_add_library(TerrainTest

target_link_libraries(TerrainTest
PRIVATE
Qt6::Positioning
Qt6::Test
Terrain
PUBLIC
Qt6::Positioning
qgcunittest
Terrain
)

target_include_directories(TerrainTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
5 changes: 2 additions & 3 deletions test/Vehicle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ qt_add_library(VehicleTest
target_link_libraries(VehicleTest
PRIVATE
Qt6::Test
PUBLIC
Comms
qgcunittest
Vehicle
INTERFACE
VehicleComponentsTest
PUBLIC
qgcunittest
)

target_include_directories(VehicleTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3 changes: 0 additions & 3 deletions test/Vehicle/SendMavCommandWithSignallingTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#include "UnitTest.h"
#include "Vehicle.h"

#include <QtTest/QTest>
#include <QtTest/QSignalSpy>

class SendMavCommandWithSignallingTest : public UnitTest
{
Q_OBJECT
Expand Down