From 84cd882daf1afab59596f2f27db5aad5ce9b8f6b Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Tue, 20 Apr 2021 09:09:59 +0300 Subject: Compile-config test for winrt While winrt as a "windows phone" is not supported anymore, the APIs are available on windows and can be supported where applicable (bluetooth, positioning, sensors, ...). This commit adds a configuration tests for the presence of these headers and libraries. Task-number: QTBUG-92502 Change-Id: Ia6dcb0a6b8ecdbcf1d1bcf79e42f95ace75f6657 Reviewed-by: Alexandru Croitor --- src/plugins/sensors/CMakeLists.txt | 2 +- src/plugins/sensors/winrt/CMakeLists.txt | 6 +++++- src/sensors/configure.cmake | 16 +++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/sensors/CMakeLists.txt b/src/plugins/sensors/CMakeLists.txt index 08bfa26a..7b0644c4 100644 --- a/src/plugins/sensors/CMakeLists.txt +++ b/src/plugins/sensors/CMakeLists.txt @@ -10,7 +10,7 @@ endif() # add_subdirectory(sensorfw) #endif() -if (WIN32 AND NOT SENSORS_PLUGINS OR "winrt" IN_LIST SENSORS_PLUGINS) +if (QT_FEATURE_winrt_sensors AND NOT SENSORS_PLUGINS OR "winrt" IN_LIST SENSORS_PLUGINS) add_subdirectory(winrt) endif() diff --git a/src/plugins/sensors/winrt/CMakeLists.txt b/src/plugins/sensors/winrt/CMakeLists.txt index 2099547e..cd8191e8 100644 --- a/src/plugins/sensors/winrt/CMakeLists.txt +++ b/src/plugins/sensors/winrt/CMakeLists.txt @@ -19,7 +19,11 @@ qt_internal_add_plugin(WinRtSensorPlugin Qt::Sensors LIBRARIES Qt::CorePrivate - runtimeobject +) + +qt_internal_extend_target(WinRtSensorPlugin CONDITION MSVC + PUBLIC_LIBRARIES + runtimeobject.lib ) #### Keys ignored in scope 1:.:.:winrt.pro:: diff --git a/src/sensors/configure.cmake b/src/sensors/configure.cmake index 06e0de59..7779bf09 100644 --- a/src/sensors/configure.cmake +++ b/src/sensors/configure.cmake @@ -13,7 +13,11 @@ endif() #### Tests - +if (WIN32 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../config.tests/winrt/CMakeLists.txt") + qt_config_compile_test("winrt_sensors" + LABEL "WinRT sensors" + PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../config.tests/winrt") +endif() #### Features @@ -24,6 +28,11 @@ qt_feature("sensorfw" PRIVATE ) # special case end +qt_feature("winrt_sensors" PRIVATE + LABEL "WinRT sensors backend" + CONDITION WIN32 AND TEST_winrt_sensors +) + qt_configure_add_summary_section(NAME "Qt Sensors") if (LINUX) # At the moment there is no Qt6 version of sensorfw, and while the @@ -35,4 +44,9 @@ if (LINUX) qt_configure_add_summary_entry(ARGS "sensorfw_enabled_with_cmake") qt_configure_add_report(MESSAGE "SensorFW support currently not enabled with cmake") endif() + +if (WIN32) + qt_configure_add_summary_entry(ARGS "winrt_sensors") +endif() + qt_configure_end_summary_section() # end of "Qt Sensors" section -- cgit v1.2.3