diff options
| author | Jun Bo Bi <jambonmcyeah@gmail.com> | 2021-08-06 15:22:18 -0400 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2022-07-10 15:38:59 -0700 |
| commit | ceed42a0eeb396c30c2bf8451b5da69fabff5da9 (patch) | |
| tree | e53a2d1d26bdd1d43899278b265b88b0bd4942f9 | |
| parent | 6cb936d0cf1a57fa461f097473b5b0b5ccaf09a1 (diff) | |
Add SDL as a submodule
| -rw-r--r-- | .gitmodules | 5 | ||||
| -rw-r--r-- | CMakeLists.txt | 21 | ||||
| -rw-r--r-- | Externals/ExternalsReferenceAll.props | 3 | ||||
| m--------- | Externals/SDL/SDL | 0 | ||||
| -rw-r--r-- | Externals/SDL/SDL2.vcxproj | 412 | ||||
| -rw-r--r-- | Source/Core/DolphinLib.props | 2 | ||||
| -rw-r--r-- | Source/Core/InputCommon/CMakeLists.txt | 32 | ||||
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | 3 | ||||
| -rw-r--r-- | Source/VSProps/Base.props | 2 | ||||
| -rw-r--r-- | Source/dolphin-emu.sln | 11 |
10 files changed, 463 insertions, 28 deletions
diff --git a/.gitmodules b/.gitmodules index 01e2ced8b6..d27084a9a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -23,3 +23,8 @@ url = https://github.com/KhronosGroup/SPIRV-Cross.git branch = master shallow = true +[submodule "SDL"] + path = Externals/SDL/SDL + url = https://github.com/libsdl-org/SDL.git + branch = main + shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index ae835b0f39..e3602d8bc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,8 +84,8 @@ option(OPROFILING "Enable profiling" OFF) # TODO: Add DSPSpy option(DSPTOOL "Build dsptool" OFF) -# Enable SDL for default on operating systems that aren't Android, Linux or Windows. -if(NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT MSVC) +# Enable SDL for default on operating systems that aren't Android or Linux. +if(NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") option(ENABLE_SDL "Enables SDL as a generic controller backend" ON) else() option(ENABLE_SDL "Enables SDL as a generic controller backend" OFF) @@ -612,6 +612,23 @@ if(UNIX) add_definitions(-DUSE_MEMORYWATCHER=1) endif() +if(ENABLE_SDL) + find_package(SDL2) + + if(SDL2_FOUND) + message(STATUS "Using system SDL2") + else() + message(STATUS "Using static SDL2 from Externals") + set(SDL_SHARED OFF) + set(SDL_SHARED_ENABLED_BY_DEFAULT OFF) + set(SDL_STATIC ON) + set(SDL_STATIC_ENABLED_BY_DEFAULT ON) + add_subdirectory(Externals/SDL/SDL) + set(SDL2_FOUND TRUE) + endif() + add_definitions(-DHAVE_SDL2=1) +endif() + if(ENABLE_ANALYTICS) message(STATUS "Enabling analytics collection (subject to end-user opt-in)") add_definitions(-DUSE_ANALYTICS=1) diff --git a/Externals/ExternalsReferenceAll.props b/Externals/ExternalsReferenceAll.props index f3a19282e4..2566a4a4a0 100644 --- a/Externals/ExternalsReferenceAll.props +++ b/Externals/ExternalsReferenceAll.props @@ -94,5 +94,8 @@ <ProjectReference Include="$(ExternalsDir)zstd\zstd.vcxproj"> <Project>{1bea10f3-80ce-4bc4-9331-5769372cdf99}</Project> </ProjectReference> + <ProjectReference Include="$(ExternalsDir)SDL\SDL2.vcxproj"> + <Project>{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}</Project> + </ProjectReference> </ItemGroup> </Project> diff --git a/Externals/SDL/SDL b/Externals/SDL/SDL new file mode 160000 +Subproject cd2dcf54afaa6d640abf8b83855f6c4b5cda457 diff --git a/Externals/SDL/SDL2.vcxproj b/Externals/SDL/SDL2.vcxproj new file mode 100644 index 0000000000..ebc599029a --- /dev/null +++ b/Externals/SDL/SDL2.vcxproj @@ -0,0 +1,412 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project> + <Import Project="..\..\Source\VSProps\Base.Macros.props" /> + <Import Project="$(VSPropsDir)Base.Targets.props" /> + <PropertyGroup Label="Globals"> + <ProjectGuid>{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}</ProjectGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <Import Project="$(VSPropsDir)Configuration.StaticLibrary.props" /> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings" /> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VSPropsDir)Base.props" /> + <Import Project="$(VSPropsDir)ClDisableAllWarnings.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>HAVE_LIBC=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="SDL\include\begin_code.h" /> + <ClInclude Include="SDL\include\close_code.h" /> + <ClInclude Include="SDL\include\SDL_assert.h" /> + <ClInclude Include="SDL\include\SDL_atomic.h" /> + <ClInclude Include="SDL\include\SDL_audio.h" /> + <ClInclude Include="SDL\include\SDL_bits.h" /> + <ClInclude Include="SDL\include\SDL_blendmode.h" /> + <ClInclude Include="SDL\include\SDL_clipboard.h" /> + <ClInclude Include="SDL\include\SDL_config_windows.h" /> + <ClInclude Include="SDL\include\SDL_config.h" /> + <ClInclude Include="SDL\include\SDL_copying.h" /> + <ClInclude Include="SDL\include\SDL_cpuinfo.h" /> + <ClInclude Include="SDL\include\SDL_egl.h" /> + <ClInclude Include="SDL\include\SDL_endian.h" /> + <ClInclude Include="SDL\include\SDL_error.h" /> + <ClInclude Include="SDL\include\SDL_events.h" /> + <ClInclude Include="SDL\include\SDL_filesystem.h" /> + <ClInclude Include="SDL\include\SDL_gamecontroller.h" /> + <ClInclude Include="SDL\include\SDL_gesture.h" /> + <ClInclude Include="SDL\include\SDL_guid.h" /> + <ClInclude Include="SDL\include\SDL_haptic.h" /> + <ClInclude Include="SDL\include\SDL_hidapi.h" /> + <ClInclude Include="SDL\include\SDL_hints.h" /> + <ClInclude Include="SDL\include\SDL_joystick.h" /> + <ClInclude Include="SDL\include\SDL_keyboard.h" /> + <ClInclude Include="SDL\include\SDL_keycode.h" /> + <ClInclude Include="SDL\include\SDL_loadso.h" /> + <ClInclude Include="SDL\include\SDL_locale.h" /> + <ClInclude Include="SDL\include\SDL_log.h" /> + <ClInclude Include="SDL\include\SDL_main.h" /> + <ClInclude Include="SDL\include\SDL_messagebox.h" /> + <ClInclude Include="SDL\include\SDL_metal.h" /> + <ClInclude Include="SDL\include\SDL_misc.h" /> + <ClInclude Include="SDL\include\SDL_mouse.h" /> + <ClInclude Include="SDL\include\SDL_mutex.h" /> + <ClInclude Include="SDL\include\SDL_name.h" /> + <ClInclude Include="SDL\include\SDL_opengl_glext.h" /> + <ClInclude Include="SDL\include\SDL_opengl.h" /> + <ClInclude Include="SDL\include\SDL_opengles.h" /> + <ClInclude Include="SDL\include\SDL_opengles2_gl2.h" /> + <ClInclude Include="SDL\include\SDL_opengles2_gl2ext.h" /> + <ClInclude Include="SDL\include\SDL_opengles2_gl2platform.h" /> + <ClInclude Include="SDL\include\SDL_opengles2_khrplatform.h" /> + <ClInclude Include="SDL\include\SDL_opengles2.h" /> + <ClInclude Include="SDL\include\SDL_pixels.h" /> + <ClInclude Include="SDL\include\SDL_platform.h" /> + <ClInclude Include="SDL\include\SDL_power.h" /> + <ClInclude Include="SDL\include\SDL_quit.h" /> + <ClInclude Include="SDL\include\SDL_rect.h" /> + <ClInclude Include="SDL\include\SDL_render.h" /> + <ClInclude Include="SDL\include\SDL_revision.h" /> + <ClInclude Include="SDL\include\SDL_rwops.h" /> + <ClInclude Include="SDL\include\SDL_scancode.h" /> + <ClInclude Include="SDL\include\SDL_sensor.h" /> + <ClInclude Include="SDL\include\SDL_shape.h" /> + <ClInclude Include="SDL\include\SDL_stdinc.h" /> + <ClInclude Include="SDL\include\SDL_surface.h" /> + <ClInclude Include="SDL\include\SDL_system.h" /> + <ClInclude Include="SDL\include\SDL_syswm.h" /> + <ClInclude Include="SDL\include\SDL_test_assert.h" /> + <ClInclude Include="SDL\include\SDL_test_common.h" /> + <ClInclude Include="SDL\include\SDL_test_compare.h" /> + <ClInclude Include="SDL\include\SDL_test_crc32.h" /> + <ClInclude Include="SDL\include\SDL_test_font.h" /> + <ClInclude Include="SDL\include\SDL_test_fuzzer.h" /> + <ClInclude Include="SDL\include\SDL_test_harness.h" /> + <ClInclude Include="SDL\include\SDL_test_images.h" /> + <ClInclude Include="SDL\include\SDL_test_log.h" /> + <ClInclude Include="SDL\include\SDL_test_md5.h" /> + <ClInclude Include="SDL\include\SDL_test_memory.h" /> + <ClInclude Include="SDL\include\SDL_test_random.h" /> + <ClInclude Include="SDL\include\SDL_test.h" /> + <ClInclude Include="SDL\include\SDL_thread.h" /> + <ClInclude Include="SDL\include\SDL_timer.h" /> + <ClInclude Include="SDL\include\SDL_touch.h" /> + <ClInclude Include="SDL\include\SDL_types.h" /> + <ClInclude Include="SDL\include\SDL_version.h" /> + <ClInclude Include="SDL\include\SDL_video.h" /> + <ClInclude Include="SDL\include\SDL_vulkan.h" /> + <ClInclude Include="SDL\include\SDL.h" /> + <ClInclude Include="SDL\src\audio\directsound\SDL_directsound.h" /> + <ClInclude Include="SDL\src\audio\disk\SDL_diskaudio.h" /> + <ClInclude Include="SDL\src\audio\dummy\SDL_dummyaudio.h" /> + <ClInclude Include="SDL\src\audio\SDL_audio_c.h" /> + <ClInclude Include="SDL\src\audio\SDL_audio_resampler_filter.h" /> + <ClInclude Include="SDL\src\audio\SDL_audiodev_c.h" /> + <ClInclude Include="SDL\src\audio\SDL_sysaudio.h" /> + <ClInclude Include="SDL\src\audio\SDL_wave.h" /> + <ClInclude Include="SDL\src\audio\wasapi\SDL_wasapi.h" /> + <ClInclude Include="SDL\src\audio\winmm\SDL_winmm.h" /> + <ClInclude Include="SDL\src\core\windows\SDL_directx.h" /> + <ClInclude Include="SDL\src\core\windows\SDL_hid.h" /> + <ClInclude Include="SDL\src\core\windows\SDL_windows.h" /> + <ClInclude Include="SDL\src\core\windows\SDL_xinput.h" /> + <ClInclude Include="SDL\src\dynapi\SDL_dynapi_overrides.h" /> + <ClInclude Include="SDL\src\dynapi\SDL_dynapi_procs.h" /> + <ClInclude Include="SDL\src\dynapi\SDL_dynapi.h" /> + <ClInclude Include="SDL\src\events\blank_cursor.h" /> + <ClInclude Include="SDL\src\events\default_cursor.h" /> + <ClInclude Include="SDL\src\events\scancodes_ascii.h" /> + <ClInclude Include="SDL\src\events\scancodes_windows.h" /> + <ClInclude Include="SDL\src\events\SDL_clipboardevents_c.h" /> + <ClInclude Include="SDL\src\events\SDL_displayevents_c.h" /> + <ClInclude Include="SDL\src\events\SDL_dropevents_c.h" /> + <ClInclude Include="SDL\src\events\SDL_events_c.h" /> + <ClInclude Include="SDL\src\events\SDL_gesture_c.h" /> + <ClInclude Include="SDL\src\events\SDL_keyboard_c.h" /> + <ClInclude Include="SDL\src\events\SDL_log.h" /> + <ClInclude Include="SDL\src\events\SDL_mouse_c.h" /> + <ClInclude Include="SDL\src\events\SDL_touch_c.h" /> + <ClInclude Include="SDL\src\events\SDL_windowevents_c.h" /> + <ClInclude Include="SDL\src\haptic\SDL_haptic_c.h" /> + <ClInclude Include="SDL\src\haptic\SDL_syshaptic.h" /> + <ClInclude Include="SDL\src\haptic\windows\SDL_dinputhaptic_c.h" /> + <ClInclude Include="SDL\src\haptic\windows\SDL_windowshaptic_c.h" /> + <ClInclude Include="SDL\src\haptic\windows\SDL_xinputhaptic_c.h" /> + <ClInclude Include="SDL\src\hidapi\hidapi\hidapi.h" /> + <ClInclude Include="SDL\src\hidapi\SDL_hidapi_c.h" /> + <ClInclude Include="SDL\src\joystick\controller_type.h" /> + <ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_rumble.h" /> + <ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapijoystick_c.h" /> + <ClInclude Include="SDL\src\joystick\SDL_gamecontrollerdb.h" /> + <ClInclude Include="SDL\src\joystick\SDL_joystick_c.h" /> + <ClInclude Include="SDL\src\joystick\SDL_sysjoystick.h" /> + <ClInclude Include="SDL\src\joystick\usb_ids.h" /> + <ClInclude Include="SDL\src\joystick\virtual\SDL_virtualjoystick_c.h" /> + <ClInclude Include="SDL\src\joystick\windows\SDL_dinputjoystick_c.h" /> + <ClInclude Include="SDL\src\joystick\windows\SDL_rawinputjoystick_c.h" /> + <ClInclude Include="SDL\src\joystick\windows\SDL_windowsjoystick_c.h" /> + <ClInclude Include="SDL\src\joystick\windows\SDL_xinputjoystick_c.h" /> + <ClInclude Include="SDL\src\locale\SDL_syslocale.h" /> + <ClInclude Include="SDL\src\misc\SDL_sysurl.h" /> + <ClInclude Include="SDL\src\power\SDL_syspower.h" /> + <ClInclude Include="SDL\src\render\direct3d\SDL_shaders_d3d.h" /> + <ClInclude Include="SDL\src\render\direct3d11\SDL_shaders_d3d11.h" /> + <ClInclude Include="SDL\src\render\direct3d12\SDL_render_d3d12_xbox.h" /> + <ClInclude Include="SDL\src\render\direct3d12\SDL_shaders_d3d12.h" /> + <ClInclude Include="SDL\src\render\opengl\SDL_glfuncs.h" /> + <ClInclude Include="SDL\src\render\opengl\SDL_shaders_gl.h" /> + <ClInclude Include="SDL\src\render\opengles2\SDL_gles2funcs.h" /> + <ClInclude Include="SDL\src\render\opengles2\SDL_shaders_gles2.h" /> + <ClInclude Include="SDL\src\render\SDL_d3dmath.h" /> + <ClInclude Include="SDL\src\render\SDL_sysrender.h" /> + <ClInclude Include="SDL\src\render\SDL_yuv_sw_c.h" /> + <ClInclude Include="SDL\src\render\software\SDL_blendfillrect.h" /> + <ClInclude Include="SDL\src\render\software\SDL_blendline.h" /> + <ClInclude Include="SDL\src\render\software\SDL_blendpoint.h" /> + <ClInclude Include="SDL\src\render\software\SDL_draw.h" /> + <ClInclude Include="SDL\src\render\software\SDL_drawline.h" /> + <ClInclude Include="SDL\src\render\software\SDL_drawpoint.h" /> + <ClInclude Include="SDL\src\render\software\SDL_render_sw_c.h" /> + <ClInclude Include="SDL\src\render\software\SDL_rotate.h" /> + <ClInclude Include="SDL\src\render\software\SDL_triangle.h" /> + <ClInclude Include="SDL\src\SDL_assert_c.h" /> + <ClInclude Include="SDL\src\SDL_dataqueue.h" /> + <ClInclude Include="SDL\src\SDL_error_c.h" /> + <ClInclude Include="SDL\src\SDL_hints_c.h" /> + <ClInclude Include="SDL\src\SDL_internal.h" /> + <ClInclude Include="SDL\src\SDL_list.h" /> + <ClInclude Include="SDL\src\sensor\dummy\SDL_dummysensor.h" /> + <ClInclude Include="SDL\src\sensor\SDL_sensor_c.h" /> + <ClInclude Include="SDL\src\sensor\SDL_syssensor.h" /> + <ClInclude Include="SDL\src\sensor\windows\SDL_windowssensor.h" /> + <ClInclude Include="SDL\src\stdlib\SDL_vacopy.h" /> + <ClInclude Include="SDL\src\thread\generic\SDL_syscond_c.h" /> + <ClInclude Include="SDL\src\thread\SDL_systhread.h" /> + <ClInclude Include="SDL\src\thread\SDL_thread_c.h" /> + <ClInclude Include="SDL\src\thread\windows\SDL_sysmutex_c.h" /> + <ClInclude Include="SDL\src\thread\windows\SDL_systhread_c.h" /> + <ClInclude Include="SDL\src\timer\SDL_timer_c.h" /> + <ClInclude Include="SDL\src\video\dummy\SDL_nullevents_c.h" /> + <ClInclude Include="SDL\src\video\dummy\SDL_nullframebuffer_c.h" /> + <ClInclude Include="SDL\src\video\dummy\SDL_nullvideo.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vk_icd.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vk_layer.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vk_platform.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vk_sdk_platform.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_android.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_beta.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_core.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_directfb.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_fuchsia.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_ggp.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_ios.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_macos.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_metal.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_vi.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_wayland.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_win32.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xcb.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xlib.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan.h" /> + <ClInclude Include="SDL\src\video\khronos\vulkan\vulkan.hpp" /> + <ClInclude Include="SDL\src\video\SDL_blit_auto.h" /> + <ClInclude Include="SDL\src\video\SDL_blit_copy.h" /> + <ClInclude Include="SDL\src\video\SDL_blit_slow.h" /> + <ClInclude Include="SDL\src\video\SDL_blit.h" /> + <ClInclude Include="SDL\src\video\SDL_egl_c.h" /> + <ClInclude Include="SDL\src\video\SDL_pixels_c.h" /> + <ClInclude Include="SDL\src\video\SDL_rect_c.h" /> + <ClInclude Include="SDL\src\video\SDL_RLEaccel_c.h" /> + <ClInclude Include="SDL\src\video\SDL_shape_internals.h" /> + <ClInclude Include="SDL\src\video\SDL_sysvideo.h" /> + <ClInclude Include="SDL\src\video\SDL_vulkan_internal.h" /> + <ClInclude Include="SDL\src\video\SDL_yuv_c.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_msctf.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_vkeys.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsclipboard.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsevents.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsframebuffer.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowskeyboard.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsmessagebox.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsmodes.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsmouse.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsopengl.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsopengles.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsshape.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowstaskdialog.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsvideo.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowsvulkan.h" /> + <ClInclude Include="SDL\src\video\windows\SDL_windowswindow.h" /> + <ClInclude Include="SDL\src\video\windows\wmmsg.h" /> + <ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_sse_func.h" /> + <ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_std_func.h" /> + <ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="SDL\src\atomic\SDL_atomic.c" /> + <ClCompile Include="SDL\src\atomic\SDL_spinlock.c" /> + <ClCompile Include="SDL\src\audio\directsound\SDL_directsound.c" /> + <ClCompile Include="SDL\src\audio\disk\SDL_diskaudio.c" /> + <ClCompile Include="SDL\src\audio\dummy\SDL_dummyaudio.c" /> + <ClCompile Include="SDL\src\audio\SDL_audio.c" /> + <ClCompile Include="SDL\src\audio\SDL_audiocvt.c" /> + <ClCompile Include="SDL\src\audio\SDL_audiodev.c" /> + <ClCompile Include="SDL\src\audio\SDL_audiotypecvt.c" /> + <ClCompile Include="SDL\src\audio\SDL_mixer.c" /> + <ClCompile Include="SDL\src\audio\SDL_wave.c" /> + <ClCompile Include="SDL\src\audio\wasapi\SDL_wasapi_win32.c" /> + <ClCompile Include="SDL\src\audio\wasapi\SDL_wasapi.c" /> + <ClCompile Include="SDL\src\audio\winmm\SDL_winmm.c" /> + <ClCompile Include="SDL\src\core\windows\SDL_hid.c" /> + <ClCompile Include="SDL\src\core\windows\SDL_windows.c" /> + <ClCompile Include="SDL\src\core\windows\SDL_xinput.c" /> + <ClCompile Include="SDL\src\cpuinfo\SDL_cpuinfo.c" /> + <ClCompile Include="SDL\src\dynapi\SDL_dynapi.c" /> + <ClCompile Include="SDL\src\events\SDL_clipboardevents.c" /> + <ClCompile Include="SDL\src\events\SDL_displayevents.c" /> + <ClCompile Include="SDL\src\events\SDL_dropevents.c" /> + <ClCompile Include="SDL\src\events\SDL_events.c" /> + <ClCompile Include="SDL\src\events\SDL_gesture.c" /> + <ClCompile Include="SDL\src\events\SDL_keyboard.c" /> + <ClCompile Include="SDL\src\events\SDL_mouse.c" /> + <ClCompile Include="SDL\src\events\SDL_quit.c" /> + <ClCompile Include="SDL\src\events\SDL_touch.c" /> + <ClCompile Include="SDL\src\events\SDL_windowevents.c" /> + <ClCompile Include="SDL\src\file\SDL_rwops.c" /> + <ClCompile Include="SDL\src\filesystem\windows\SDL_sysfilesystem.c" /> + <ClCompile Include="SDL\src\haptic\dummy\SDL_syshaptic.c" /> + <ClCompile Include="SDL\src\haptic\SDL_haptic.c" /> + <ClCompile Include="SDL\src\haptic\windows\SDL_dinputhaptic.c" /> + <ClCompile Include="SDL\src\haptic\windows\SDL_windowshaptic.c" /> + <ClCompile Include="SDL\src\haptic\windows\SDL_xinputhaptic.c" /> + <ClCompile Include="SDL\src\hidapi\SDL_hidapi.c" /> + <ClCompile Include="SDL\src\joystick\controller_type.c" /> + <ClCompile Include="SDL\src\joystick\dummy\SDL_sysjoystick.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_gamecube.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_luna.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_ps4.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_ps5.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_rumble.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_shield.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_stadia.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_switch.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_xbox360.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_xbox360w.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_xboxone.c" /> + <ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapijoystick.c" /> + <ClCompile Include="SDL\src\joystick\SDL_gamecontroller.c" /> + <ClCompile Include="SDL\src\joystick\SDL_joystick.c" /> + <ClCompile Include="SDL\src\joystick\virtual\SDL_virtualjoystick.c" /> + <ClCompile Include="SDL\src\joystick\windows\SDL_dinputjoystick.c" /> + <ClCompile Include="SDL\src\joystick\windows\SDL_rawinputjoystick.c" /> + <ClCompile Include="SDL\src\joystick\windows\SDL_windows_gaming_input.c" /> + <ClCompile Include="SDL\src\joystick\windows\SDL_windowsjoystick.c" /> + <ClCompile Include="SDL\src\joystick\windows\SDL_xinputjoystick.c" /> + <ClCompile Include="SDL\src\loadso\windows\SDL_sysloadso.c" /> + <ClCompile Include="SDL\src\locale\SDL_locale.c" /> + <ClCompile Include="SDL\src\locale\windows\SDL_syslocale.c" /> + <ClCompile Include="SDL\src\misc\SDL_url.c" /> + <ClCompile Include="SDL\src\misc\windows\SDL_sysurl.c" /> + <ClCompile Include="SDL\src\power\SDL_power.c" /> + <ClCompile Include="SDL\src\power\windows\SDL_syspower.c" /> + <ClCompile Include="SDL\src\render\direct3d\SDL_render_d3d.c" /> + <ClCompile Include="SDL\src\render\direct3d\SDL_shaders_d3d.c" /> + <ClCompile Include="SDL\src\render\direct3d11\SDL_render_d3d11.c" /> + <ClCompile Include="SDL\src\render\direct3d11\SDL_shaders_d3d11.c" /> + <ClCompile Include="SDL\src\render\direct3d12\SDL_render_d3d12.c" /> + <ClCompile Include="SDL\src\render\direct3d12\SDL_shaders_d3d12.c" /> + <ClCompile Include="SDL\src\render\opengl\SDL_render_gl.c" /> + <ClCompile Include="SDL\src\render\opengl\SDL_shaders_gl.c" /> + <ClCompile Include="SDL\src\render\opengles2\SDL_render_gles2.c" /> + <ClCompile Include="SDL\src\render\opengles2\SDL_shaders_gles2.c" /> + <ClCompile Include="SDL\src\render\SDL_d3dmath.c" /> + <ClCompile Include="SDL\src\render\SDL_render.c" /> + <ClCompile Include="SDL\src\render\SDL_yuv_sw.c" /> + <ClCompile Include="SDL\src\render\software\SDL_blendfillrect.c" /> + <ClCompile Include="SDL\src\render\software\SDL_blendline.c" /> + <ClCompile Include="SDL\src\render\software\SDL_blendpoint.c" /> + <ClCompile Include="SDL\src\render\software\SDL_drawline.c" /> + <ClCompile Include="SDL\src\render\software\SDL_drawpoint.c" /> + <ClCompile Include="SDL\src\render\software\SDL_render_sw.c" /> + <ClCompile Include="SDL\src\render\software\SDL_rotate.c" /> + <ClCompile Include="SDL\src\render\software\SDL_triangle.c" /> + <ClCompile Include="SDL\src\SDL_assert.c" /> + <ClCompile Include="SDL\src\SDL_dataqueue.c" /> + <ClCompile Include="SDL\src\SDL_error.c" /> + <ClCompile Include="SDL\src\SDL_guid.c" /> + <ClCompile Include="SDL\src\SDL_hints.c" /> + <ClCompile Include="SDL\src\SDL_list.c" /> + <ClCompile Include="SDL\src\SDL_log.c" /> + <ClCompile Include="SDL\src\SDL.c" /> + <ClCompile Include="SDL\src\sensor\dummy\SDL_dummysensor.c" /> + <ClCompile Include="SDL\src\sensor\SDL_sensor.c" /> + <ClCompile Include="SDL\src\sensor\windows\SDL_windowssensor.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_crc32.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_getenv.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_iconv.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_malloc.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_memcpy.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_memset.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_qsort.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_stdlib.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_string.c" /> + <ClCompile Include="SDL\src\stdlib\SDL_strtokr.c" /> + <ClCompile Include="SDL\src\thread\generic\SDL_syscond.c" /> + <ClCompile Include="SDL\src\thread\SDL_thread.c" /> + <ClCompile Include="SDL\src\thread\windows\SDL_syscond_cv.c" /> + <ClCompile Include="SDL\src\thread\windows\SDL_sysmutex.c" /> + <ClCompile Include="SDL\src\thread\windows\SDL_syssem.c" /> + <ClCompile Include="SDL\src\thread\windows\SDL_systhread.c" /> + <ClCompile Include="SDL\src\thread\windows\SDL_systls.c" /> + <ClCompile Include="SDL\src\timer\SDL_timer.c" /> + <ClCompile Include="SDL\src\timer\windows\SDL_systimer.c" /> + <ClCompile Include="SDL\src\video\dummy\SDL_nullevents.c" /> + <ClCompile Include="SDL\src\video\dummy\SDL_nullframebuffer.c" /> + <ClCompile Include="SDL\src\video\dummy\SDL_nullvideo.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_0.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_1.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_A.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_auto.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_copy.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_N.c" /> + <ClCompile Include="SDL\src\video\SDL_blit_slow.c" /> + <ClCompile Include="SDL\src\video\SDL_blit.c" /> + <ClCompile Include="SDL\src\video\SDL_bmp.c" /> + <ClCompile Include="SDL\src\video\SDL_clipboard.c" /> + <ClCompile Include="SDL\src\video\SDL_egl.c" /> + <ClCompile Include="SDL\src\video\SDL_fillrect.c" /> + <ClCompile Include="SDL\src\video\SDL_pixels.c" /> + <ClCompile Include="SDL\src\video\SDL_rect.c" /> + <ClCompile Include="SDL\src\video\SDL_RLEaccel.c" /> + <ClCompile Include="SDL\src\video\SDL_shape.c" /> + <ClCompile Include="SDL\src\video\SDL_stretch.c" /> + <ClCompile Include="SDL\src\video\SDL_surface.c" /> + <ClCompile Include="SDL\src\video\SDL_video.c" /> + <ClCompile Include="SDL\src\video\SDL_vulkan_utils.c" /> + <ClCompile Include="SDL\src\video\SDL_yuv.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsclipboard.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsevents.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsframebuffer.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowskeyboard.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsmessagebox.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsmodes.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsmouse.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsopengl.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsopengles.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsshape.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsvideo.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowsvulkan.c" /> + <ClCompile Include="SDL\src\video\windows\SDL_windowswindow.c" /> + <ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb.c" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Source/Core/DolphinLib.props b/Source/Core/DolphinLib.props index 8cb5919edf..2e7e546c78 100644 --- a/Source/Core/DolphinLib.props +++ b/Source/Core/DolphinLib.props @@ -493,6 +493,7 @@ <ClInclude Include="InputCommon\ControllerInterface\Wiimote\WiimoteController.h" /> <ClInclude Include="InputCommon\ControllerInterface\Win32\Win32.h" /> <ClInclude Include="InputCommon\ControllerInterface\XInput\XInput.h" /> + <ClInclude Include="InputCommon\ControllerInterface\SDL\SDL.h" /> <ClInclude Include="InputCommon\ControlReference\ControlReference.h" /> <ClInclude Include="InputCommon\ControlReference\ExpressionParser.h" /> <ClInclude Include="InputCommon\ControlReference\FunctionExpression.h" /> @@ -1104,6 +1105,7 @@ <ClCompile Include="InputCommon\ControllerInterface\Wiimote\WiimoteController.cpp" /> <ClCompile Include="InputCommon\ControllerInterface\Win32\Win32.cpp" /> <ClCompile Include="InputCommon\ControllerInterface\XInput\XInput.cpp" /> + <ClCompile Include="InputCommon\ControllerInterface\SDL\SDL.cpp" /> <ClCompile Include="InputCommon\ControlReference\ControlReference.cpp" /> <ClCompile Include="InputCommon\ControlReference\ExpressionParser.cpp" /> <ClCompile Include="InputCommon\ControlReference\FunctionExpression.cpp" /> diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 06f959a91a..9cca78b65d 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -174,32 +174,12 @@ if(UNIX) ) endif() -if(ENABLE_SDL) - find_package(SDL2) - if(SDL2_FOUND) - message(STATUS "Using shared SDL2") - set(SDL_TARGET SDL2::SDL2) - else() - # SDL2 not found, try SDL - find_package(SDL) - if(SDL_FOUND) - message(STATUS "Using shared SDL") - add_library(System_SDL INTERFACE) - target_include_directories(System_SDL INTERFACE ${SDL_INCLUDE_DIR}) - target_link_libraries(System_SDL INTERFACE ${SDL_LIBRARY}) - set(SDL_TARGET System_SDL) - endif() - endif() - if(SDL_TARGET AND TARGET ${SDL_TARGET}) - target_sources(inputcommon PRIVATE - ControllerInterface/SDL/SDL.cpp - ControllerInterface/SDL/SDL.h - ) - target_link_libraries(inputcommon PRIVATE ${SDL_TARGET}) - target_compile_definitions(inputcommon PRIVATE "CIFACE_USE_SDL=1") - else() - message(STATUS "SDL NOT found, disabling SDL input") - endif() +if(SDL2_FOUND) + target_sources(inputcommon PRIVATE + ControllerInterface/SDL/SDL.cpp + ControllerInterface/SDL/SDL.h + ) + target_link_libraries(inputcommon PRIVATE SDL2::SDL2) endif() if(MSVC) diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index 7a5ee0ad26..2f43cacc42 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -30,6 +30,9 @@ #define CIFACE_USE_PIPES #endif #define CIFACE_USE_DUALSHOCKUDPCLIENT +#if defined(HAVE_SDL2) +#define CIFACE_USE_SDL +#endif namespace ciface { diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index 49f546d39f..ae821339cc 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -52,6 +52,7 @@ <AdditionalIncludeDirectories>$(ExternalsDir)picojson;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ExternalsDir)pugixml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ExternalsDir)rangeset\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(ExternalsDir)SDL\SDL\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ExternalsDir)SFML\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ExternalsDir)soundtouch;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ExternalsDir)Vulkan\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> @@ -91,6 +92,7 @@ <PreprocessorDefinitions>HAS_LIBMGBA;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>AUTOUPDATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>HAVE_SDL2=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <!-- Make sure we include a clean version of windows.h. --> diff --git a/Source/dolphin-emu.sln b/Source/dolphin-emu.sln index 89df520d9b..b289f27548 100644 --- a/Source/dolphin-emu.sln +++ b/Source/dolphin-emu.sln @@ -81,6 +81,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "..\Externals\fmt\fmt EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spirv_cross", "..\Externals\spirv_cross\spirv_cross.vcxproj", "{3d780617-ec8c-4721-b9fd-dfc9bb658c7c}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "..\Externals\SDL\SDL2.vcxproj", "{8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -389,6 +391,14 @@ Global {3D780617-EC8C-4721-B9FD-DFC9BB658C7C}.Release|ARM64.Build.0 = Release|ARM64 {3D780617-EC8C-4721-B9FD-DFC9BB658C7C}.Release|x64.ActiveCfg = Release|x64 {3D780617-EC8C-4721-B9FD-DFC9BB658C7C}.Release|x64.Build.0 = Release|x64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|ARM64.Build.0 = Debug|ARM64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|x64.ActiveCfg = Debug|x64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Debug|x64.Build.0 = Debug|x64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|ARM64.ActiveCfg = Release|ARM64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|ARM64.Build.0 = Release|ARM64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.ActiveCfg = Release|x64 + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -422,6 +432,7 @@ Global {864C4C8E-296D-3DBC-AD83-F1D5CB6E8EC6} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {4BC5A148-0AB3-440F-A980-A29B4B999190} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} {3D780617-EC8C-4721-B9FD-DFC9BB658C7C} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} + {8DC244EE-A0BD-4038-BAF7-CFAFA5EB2BAA} = {87ADDFF9-5768-4DA2-A33B-2477593D6677} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {64B0A343-3B94-4522-9C24-6937FE5EFB22} |
