From 0fe02af0e8ce976eaca9225d19b501f627723bd9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 24 Apr 2020 15:19:04 -0700 Subject: build-system/android: remove libusb at QTest We no longer use libusb to access USB devices on Android, therefore there's no point including libusb in our build. Also, we have never even attempted to run the tests on Android, so let's not even pretend to support building them. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ea1ab212..3faf72c63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,7 +152,10 @@ else() pkg_config_library(LIBXSLT libxslt REQUIRED) endif() pkg_config_library(LIBZIP libzip REQUIRED) -pkg_config_library(LIBUSB libusb-1.0 QUIET) + +if(NOT ANDROID) + pkg_config_library(LIBUSB libusb-1.0 QUIET) +endif() include_directories(. ${CMAKE_CURRENT_BINARY_DIR} @@ -190,6 +193,7 @@ endif() if(ANDROID) set(NO_PRINTING ON) set(NO_USERMANUAL ON) + set(MAKE_TESTS OFF) list(APPEND QT_EXTRA_COMPONENTS AndroidExtras) set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -llog) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -257,12 +261,18 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable") find_package(Qt5 5.9.1 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS} LinguistTools Test QuickTest) else() # Kirigami 5.62 and newer require at least Qt 5.12 - find_package(Qt5 5.12 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS} LinguistTools Test QuickTest) + if(ANDROID) + find_package(Qt5 5.12 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS} LinguistTools) + else() + find_package(Qt5 5.12 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS} LinguistTools Test QuickTest) + endif() endif() foreach(_QT_COMPONENT ${QT_FIND_COMPONENTS}) list(APPEND QT_LIBRARIES Qt5::${_QT_COMPONENT}) endforeach() -set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test Qt5::QuickTest) +if(NOT ANDROID) + set(QT_TEST_LIBRARIES ${QT_LIBRARIES} Qt5::Test Qt5::QuickTest) +endif() #set up the subsurface_link_libraries variable set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES}) -- cgit v1.2.3-70-g09d2