From a6d05742acad7083eb09ce488a86346bf80bee70 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 5 Aug 2022 21:57:24 +0200 Subject: [PATCH] CMake: Disable wxUSE_JOYSTICK by default on non-Linux UNIX systems (cherry picked from commit ebcec1f8b7941e1808d2713aafd0aac48c75ff7d) --- build/cmake/options.cmake | 7 ++++++- build/cmake/setup.cmake | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 49c536a07f..02dc4aca6f 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -423,7 +423,12 @@ wx_option(wxUSE_MOUSEWHEEL "use mousewheel") wx_option(wxUSE_VALIDATORS "use wxValidator and derived classes") wx_option(wxUSE_BUSYINFO "use wxBusyInfo") wx_option(wxUSE_HOTKEY "use wxWindow::RegisterHotKey()") -wx_option(wxUSE_JOYSTICK "use wxJoystick") +if(UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(wxUSE_JOYSTICK_DEFAULT OFF) +else() + set(wxUSE_JOYSTICK_DEFAULT ON) +endif() +wx_option(wxUSE_JOYSTICK "use wxJoystick" ${wxUSE_JOYSTICK_DEFAULT}) wx_option(wxUSE_METAFILE "use wxMetaFile") wx_option(wxUSE_DRAGIMAGE "use wxDragImage") wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)") diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 2ecaed993e..365c1f3a62 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -445,7 +445,7 @@ if(UNIX) check_symbol_exists(inet_addr arpa/inet.h HAVE_INET_ADDR) endif(wxUSE_SOCKETS) - if(WXGTK AND NOT APPLE) + if(wxUSE_JOYSTICK AND NOT APPLE) check_include_files("linux/joystick.h" HAVE_JOYSTICK_H) if(NOT HAVE_JOYSTICK_H) message(WARNING "wxJoystick is not available")