Skip to content

Commit c66e988

Browse files
committed
Merge bitcoin#33865: cmake: Specify Windows plugin path in test_bitcoin-qt property
0dd8d5c cmake: Specify Windows plugin path in `test_bitcoin-qt` property (Hennadii Stepanov) Pull request description: This PR simplifies testing on Windows by removing the need to set the `QT_PLUGIN_PATH` environment variable for different build configurations. For example, the paths might otherwise be: - `C:/Users/hebasto/dev/bitcoin/build/vcpkg_installed/x64-windows/Qt6/plugins/` for "Release" - `C:/Users/hebasto/dev/bitcoin/build/vcpkg_installed/x64-windows/debug/Qt6/plugins/` for "Debug" ACKs for top commit: purpleKarrot: ACK 0dd8d5c Tree-SHA512: 0418b8fa4d74ca500aae9e36e56ebcefb566d2ac04a9d22e17d309400ad38dd5a6e75f0195c680796b761fb145444c33336b64180f15c6b1125fe190d58396b6
2 parents e221b25 + 0dd8d5c commit c66e988

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ jobs:
295295
- name: Run test suite
296296
if: matrix.job-type == 'standard'
297297
working-directory: build
298-
env:
299-
QT_PLUGIN_PATH: '${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins'
300298
run: |
301299
ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release
302300

src/qt/test/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ add_test(NAME test_bitcoin-qt
4040
COMMAND test_bitcoin-qt
4141
)
4242
if(WIN32 AND VCPKG_TARGET_TRIPLET)
43-
# On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
44-
# the "minimal" platform plugin unusable due to internal Qt bugs.
45-
set_tests_properties(test_bitcoin-qt PROPERTIES
46-
ENVIRONMENT "QT_QPA_PLATFORM=windows"
43+
set(plugin_path "$<SHELL_PATH:$<PATH:GET_PARENT_PATH,$<PATH:GET_PARENT_PATH,$<TARGET_PROPERTY:Qt6::QWindowsIntegrationPlugin,LOCATION_$<CONFIG>>>>>")
44+
set_property(TEST test_bitcoin-qt APPEND PROPERTY
45+
ENVIRONMENT_MODIFICATION
46+
# On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
47+
# the "minimal" platform plugin unusable due to internal Qt bugs.
48+
QT_QPA_PLATFORM=set:windows
49+
QT_PLUGIN_PATH=set:${plugin_path}
4750
)
51+
unset(plugin_path)
4852
endif()
4953

5054
install_binary_component(test_bitcoin-qt INTERNAL)

0 commit comments

Comments
 (0)