Bug 1324147 - Remove MOZ_GAMEPAD_BACKEND; r?daoshengmu draft
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 27 Jun 2018 12:32:36 -0700
changeset 811547 d810696c789cf5dc3c7e2069573ef5ef728033c1
parent 811302 9c7bb8874337c2d40aef3d9945b10490a5115188
push id114340
push userbmo:kyle@nonpolynomial.com
push dateWed, 27 Jun 2018 19:35:23 +0000
reviewersdaoshengmu
bugs1324147
milestone63.0a1
Bug 1324147 - Remove MOZ_GAMEPAD_BACKEND; r?daoshengmu MOZ_WIDGET_TOOLKIT can be used for platform choice for Gamepad. Need to leave linux header check in configure for now. MozReview-Commit-ID: VT7T2KmLts
dom/gamepad/moz.build
old-configure.in
--- a/dom/gamepad/moz.build
+++ b/dom/gamepad/moz.build
@@ -41,35 +41,35 @@ UNIFIED_SOURCES = [
     'GamepadPose.cpp',
     'GamepadServiceTest.cpp',
     'ipc/GamepadEventChannelChild.cpp',
     'ipc/GamepadEventChannelParent.cpp',
     'ipc/GamepadTestChannelChild.cpp',
     'ipc/GamepadTestChannelParent.cpp'
 ]
 
-if CONFIG['MOZ_GAMEPAD_BACKEND'] == 'stub':
-    UNIFIED_SOURCES += [
-        'fallback/FallbackGamepad.cpp'
-    ]
-elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'cocoa':
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
         'cocoa/CocoaGamepad.cpp'
     ]
-elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'windows':
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     UNIFIED_SOURCES += [
         'windows/WindowsGamepad.cpp'
     ]
-elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'linux':
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+    UNIFIED_SOURCES += [
+        'android/AndroidGamepad.cpp'
+    ]
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
     UNIFIED_SOURCES += [
         'linux/LinuxGamepad.cpp'
     ]
-elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'android':
+else:
     UNIFIED_SOURCES += [
-        'android/AndroidGamepad.cpp'
+        'fallback/FallbackGamepad.cpp'
     ]
 
 LOCAL_INCLUDES += [
     'ipc',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -2672,42 +2672,24 @@ if test -n "$MOZ_ANGLE_RENDERER"; then
 fi # MOZ_ANGLE_RENDERER
 
 fi # COMPILE_ENVIRONMENT
 
 
 dnl ========================================================
 dnl Gamepad support
 dnl ========================================================
-MOZ_GAMEPAD_BACKEND=stub
-
-case "$OS_TARGET" in
-Darwin)
-    if test -z "$MOZ_IOS"; then
-        MOZ_GAMEPAD_BACKEND=cocoa
-    fi
-    ;;
-WINNT)
-    MOZ_GAMEPAD_BACKEND=windows
-    ;;
-Linux)
+
+dnl Moved gamepad platform check to moz.build, linux header check still needed here.
+if test "$OS_TARGET" = "Linux"; then
     MOZ_CHECK_HEADER([linux/joystick.h])
     if test "$ac_cv_header_linux_joystick_h" != "yes"; then
       AC_MSG_ERROR([Can't find header linux/joystick.h, needed for gamepad support. Please install Linux kernel headers.])
     fi
-    MOZ_GAMEPAD_BACKEND=linux
-    ;;
-Android)
-    MOZ_GAMEPAD_BACKEND=android
-    ;;
-*)
-    ;;
-esac
-
-AC_SUBST(MOZ_GAMEPAD_BACKEND)
+fi
 
 dnl ========================================================
 dnl = Breakpad crash reporting (on by default on supported platforms)
 dnl ========================================================
 
 case $target in
 i?86-*-mingw*|x86_64-*-mingw*)
   MOZ_CRASHREPORTER=1