Skip to content

Commit

Permalink
Merge branch 'feature/static-linkage' into 'main'
Browse files Browse the repository at this point in the history
Support static linkage of module plugins for static builds.

See merge request asxa86/aspire!13
  • Loading branch information
ASxa86 committed Nov 10, 2024
2 parents b906e18 + 72673a9 commit cf65b32
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 18 deletions.
16 changes: 3 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Aspire Edit Debug",
"name": "(Windows) Pong Debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-debug/installed/bin/aspire-edit.exe",
"program": "${workspaceFolder}/build/installed/bin/pong.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build-debug/installed/bin",
"console": "externalTerminal"
},
{
"name": "(Windows) Aspire EDH Debug",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build-debug/installed/bin/aspire-edh.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build-debug/installed/bin",
"cwd": "${workspaceFolder}/build/installed/bin",
"console": "externalTerminal"
}
]
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ qt_standard_project_setup(REQUIRES 6.7)

set(CMAKE_AUTOMOC ON)

add_subdirectory(app)
add_subdirectory(module)
add_subdirectory(app)
3 changes: 3 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"cmake/preset/host-x64-linux.json",
"cmake/preset/host-x64-windows.json",
"cmake/preset/target-arm64-android.json",
"cmake/preset/target-arm64-osx.json",
"cmake/preset/target-arm64-windows.json",
"cmake/preset/target-x64-android.json",
"cmake/preset/target-x64-linux.json",
Expand Down Expand Up @@ -97,6 +98,7 @@
"name": "arm64-osx-clang-debug",
"inherits": [
"host-arm64-osx",
"target-arm64-osx",
"config-debug",
"config-build-dir",
"use-clang",
Expand All @@ -108,6 +110,7 @@
"name": "arm64-osx-clang-release",
"inherits": [
"host-arm64-osx",
"target-arm64-osx",
"config-release",
"config-build-dir",
"use-clang",
Expand Down
8 changes: 8 additions & 0 deletions app/pong/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
Qt::Quick
)

# Link against plugins for static builds.
if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin OR ${CMAKE_SYSTEM_NAME} STREQUAL Linux)
target_link_libraries(${PROJECT_NAME} PRIVATE
aspireplugin
)
endif()

# Android APKs are handle separately within Qt cmake scripts.
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL Android)
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION .
Expand Down
3 changes: 1 addition & 2 deletions cmake/preset/host-arm64-osx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"rhs": "Darwin"
},
"cacheVariables": {
"VCPKG_HOST_TRIPLET": "arm64-osx-release",
"VCPKG_TARGET_TRIPLET": "arm64-osx-release"
"VCPKG_HOST_TRIPLET": "arm64-osx-aspire"
}
}
]
Expand Down
13 changes: 13 additions & 0 deletions cmake/preset/target-arm64-osx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 6,
"configurePresets": [
{
"name": "target-arm64-osx",
"hidden": true,
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-osx-aspire",
"BUILD_SHARED_LIBS": false
}
}
]
}
3 changes: 2 additions & 1 deletion cmake/preset/target-x64-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"name": "target-x64-linux",
"hidden": true,
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-linux-aspire"
"VCPKG_TARGET_TRIPLET": "x64-linux-aspire",
"BUILD_SHARED_LIBS": false
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion module/aspire/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(aspire-test)

qt_add_executable(${PROJECT_NAME})
add_executable(${PROJECT_NAME})

target_sources(${PROJECT_NAME} PRIVATE
main.cpp
Expand Down

0 comments on commit cf65b32

Please sign in to comment.