diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/windows/SCsub | 2 | ||||
| -rw-r--r-- | platform/x11/detect.py | 29 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 6 |
3 files changed, 22 insertions, 15 deletions
diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 2db3d0f51e..914cee0fa1 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -24,4 +24,4 @@ env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX if (env['vsproj'])=="yes": env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: - env.vs_srcs = env.vs_srcs + ["platform/windows/" + x] + env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)] diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 0226c8b8c0..344545ab81 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -55,6 +55,7 @@ def get_opts(): ('use_sanitizer','Use llvm compiler sanitize address','no'), ('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'), ('pulseaudio','Detect & Use pulseaudio','yes'), + ('gamepad','Gamepad support, requires libudev and libevdev','yes'), ('new_wm_api', 'Use experimental window management API','no'), ('debug_release', 'Add debug symbols to release version','no'), ] @@ -145,23 +146,29 @@ def configure(env): env.Append(CPPPATH=['#tools/freetype/freetype/include']) - - env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) if platform.system() == 'Linux': env.Append(CPPFLAGS=["-DALSA_ENABLED"]) env.Append(LIBS=['asound']) - if not os.system("pkg-config --exists libudev"): - if not os.system("pkg-config --exists libevdev"): - print("Enabling udev/evdev") - env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) - env.ParseConfig('pkg-config libudev --cflags --libs') - env.ParseConfig('pkg-config libevdev --cflags --libs') - else: - print("libevdev development libraries not found, disabling gamepad support") + if (env["gamepad"]=="yes" and platform.system() == "Linux"): + # pkg-config returns 0 when the lib exists... + found_udev = not os.system("pkg-config --exists libudev") + found_evdev = not os.system("pkg-config --exists libevdev") + + if (found_udev and found_evdev): + print("Enabling gamepad support with udev/evdev") + env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) + env.ParseConfig('pkg-config libudev --cflags --libs') + env.ParseConfig('pkg-config libevdev --cflags --libs') else: - print("libudev development libraries not found, disabling gamepad support") + if (not found_udev): + print("libudev development libraries not found") + if (not found_evdev): + print("libevdev development libraries not found") + print("Some libraries are missing for the required gamepad support, aborting!") + print("Install the mentioned libraries or build with 'gamepad=no' to disable gamepad support.") + sys.exit(255) if (env["pulseaudio"]=="yes"): if not os.system("pkg-config --exists libpulse-simple"): diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 75ec9fd5de..437e41eead 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -447,6 +447,9 @@ void OS_X11::finalize() { // memdelete(debugger_connection_console); //} +#ifdef JOYDEV_ENABLED + memdelete(joystick); +#endif memdelete(input); memdelete(sample_manager); @@ -463,9 +466,6 @@ void OS_X11::finalize() { physics_2d_server->finish(); memdelete(physics_2d_server); -#ifdef JOYDEV_ENABLED - memdelete(joystick); -#endif XUnmapWindow( x11_display, x11_window ); XDestroyWindow( x11_display, x11_window ); |