diff options
| author | 2026-02-07 13:32:37 -0500 | |
|---|---|---|
| committer | 2026-02-07 13:32:37 -0500 | |
| commit | 8349e95e3e0ea4d3081739e2b8bb5787b9e366ba (patch) | |
| tree | 89c058b1454f3c898fb918dc2ce1c7a2fb701e4b /scripts | |
| parent | dba6d057f1186642e73eb7fa020aabf9647b163f (diff) | |
Initial support for SDL3. [R. Belmont, Vas Crabb]
* SDL3 is the default for macOS targets. Linux/Windows can build with
OSD=sdl3 while we wait for better distro support for SDL3. Both X11 and
Wayland sessions are fully supported on Linux.
* SDL3 -sound=sdl supports both input and output. All other video, sound,
and input functionality should otherwise be the same for now. SDL 3.4+
multiple keyboard/mouse support is planned.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/src/osd/modules.lua | 5 | ||||
| -rw-r--r-- | scripts/src/osd/sdl3.lua | 446 | ||||
| -rw-r--r-- | scripts/src/osd/sdl3_cfg.lua | 167 | ||||
| -rw-r--r-- | scripts/src/osd/windows.lua | 25 | ||||
| -rw-r--r-- | scripts/src/osd/windows_cfg.lua | 11 | ||||
| -rw-r--r-- | scripts/src/tools.lua | 5 |
6 files changed, 652 insertions, 7 deletions
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index 4b796a1f5b4..fddf73b4046 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -79,6 +79,7 @@ function osdmodulesbuild() MAME_DIR .. "src/osd/modules/font/font_none.cpp", MAME_DIR .. "src/osd/modules/font/font_osx.cpp", MAME_DIR .. "src/osd/modules/font/font_sdl.cpp", + MAME_DIR .. "src/osd/modules/font/font_sdl3.cpp", MAME_DIR .. "src/osd/modules/font/font_windows.cpp", MAME_DIR .. "src/osd/modules/input/assignmenthelper.cpp", MAME_DIR .. "src/osd/modules/input/assignmenthelper.h", @@ -91,6 +92,7 @@ function osdmodulesbuild() MAME_DIR .. "src/osd/modules/input/input_none.cpp", MAME_DIR .. "src/osd/modules/input/input_rawinput.cpp", MAME_DIR .. "src/osd/modules/input/input_sdl.cpp", + MAME_DIR .. "src/osd/modules/input/input_sdl3.cpp", MAME_DIR .. "src/osd/modules/input/input_win32.cpp", MAME_DIR .. "src/osd/modules/input/input_wincommon.h", MAME_DIR .. "src/osd/modules/input/input_windows.cpp", @@ -129,6 +131,8 @@ function osdmodulesbuild() MAME_DIR .. "src/osd/modules/render/drawnone.cpp", MAME_DIR .. "src/osd/modules/render/drawogl.cpp", MAME_DIR .. "src/osd/modules/render/drawsdl.cpp", + MAME_DIR .. "src/osd/modules/render/drawsdl3accel.cpp", + MAME_DIR .. "src/osd/modules/render/drawsdl3soft.cpp", MAME_DIR .. "src/osd/modules/render/render_module.h", MAME_DIR .. "src/osd/modules/sound/coreaudio_sound.cpp", MAME_DIR .. "src/osd/modules/sound/js_sound.cpp", @@ -139,6 +143,7 @@ function osdmodulesbuild() MAME_DIR .. "src/osd/modules/sound/pulse_sound.cpp", MAME_DIR .. "src/osd/modules/sound/pipewire_sound.cpp", MAME_DIR .. "src/osd/modules/sound/sdl_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/sdl3_sound.cpp", MAME_DIR .. "src/osd/modules/sound/sound_module.cpp", MAME_DIR .. "src/osd/modules/sound/sound_module.h", MAME_DIR .. "src/osd/modules/sound/wasapi_sound.cpp", diff --git a/scripts/src/osd/sdl3.lua b/scripts/src/osd/sdl3.lua new file mode 100644 index 00000000000..18c20675281 --- /dev/null +++ b/scripts/src/osd/sdl3.lua @@ -0,0 +1,446 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- sdl3.lua +-- +-- Rules for the building with SDL +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + + +function maintargetosdoptions(_target,_subtarget) + osdmodulestargetconf() + + if _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + libdirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + linkoptions { + "-Wl,-rpath=" .. path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + end + + if _OPTIONS["NO_X11"]~="1" then + links { + "X11", + "Xinerama", + } + else + if _OPTIONS["targetos"]=="linux" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="openbsd" then + links { + "EGL", + } + end + end + + if _OPTIONS["NO_USE_XINPUT"]~="1" then + links { + "Xext", + "Xi", + } + end + + if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" and _OPTIONS["targetos"]~="asmjs" then + links { + "SDL3_ttf", + } + local str = backtick(pkgconfigcmd() .. " --libs fontconfig") + addlibfromstring(str) + addoptionsfromstring(str) + end + + if _OPTIONS["targetos"]=="windows" then + if _OPTIONS["USE_LIBSDL"]~="1" then + configuration { "mingw*"} + links { + "SDL3", + } + configuration { "vs*" } + links { + "SDL3", + "imm32", + "version", + } + configuration { } + else + local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) + end + configuration { "x32", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x86") + } + configuration { "x64", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") + } + configuration { } + + links { + "dinput8", + "psapi", + } + elseif _OPTIONS["targetos"]=="haiku" then + links { + "network", + "bsd", + } + end + + configuration { "mingw*" or "vs*" } + targetprefix "sdl" + links { + "psapi", + "ole32", + } + configuration { } +end + + +function sdlconfigcmd() + if _OPTIONS["targetos"]=="asmjs" then + return "sdl3-config" + elseif _OPTIONS["SDL_PKGCONFIG_PATH"] then + return path.join(_OPTIONS["SDL_PKGCONFIG_PATH"],"pkg-config") .. " sdl3" + elseif not _OPTIONS["SDL_INSTALL_ROOT"] then + return pkgconfigcmd() .. " sdl3" + else + return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin","sdl3") .. "-config" + end +end + + +newoption { + trigger = "MESA_INSTALL_ROOT", + description = "link against specific GL-Library - also adds rpath to executable (overridden by USE_DISPATCH_GL)", +} + +newoption { + trigger = "SDL_INI_PATH", + description = "Default search path for .ini files", +} + +newoption { + trigger = "NO_X11", + description = "Disable use of X11", + allowed = { + { "0", "Enable X11" }, + { "1", "Disable X11" }, + }, +} + +if not _OPTIONS["NO_X11"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" or _OPTIONS["targetos"]=="android" then + _OPTIONS["NO_X11"] = "1" + else + _OPTIONS["NO_X11"] = "0" + end +end + +newoption { + trigger = "NO_USE_XINPUT", + description = "Disable use of Xinput", + allowed = { + { "0", "Enable Xinput" }, + { "1", "Disable Xinput" }, + }, +} + +if not _OPTIONS["NO_USE_XINPUT"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" or _OPTIONS["targetos"]=="android" then + _OPTIONS["NO_USE_XINPUT"] = "1" + else + _OPTIONS["NO_USE_XINPUT"] = "0" + end +end + +newoption { + trigger = "NO_USE_XINPUT_WII_LIGHTGUN_HACK", + description = "Disable use of Xinput Wii Lightgun Hack", + allowed = { + { "0", "Enable Xinput Wii Lightgun Hack" }, + { "1", "Disable Xinput Wii Lightgun Hack" }, + }, +} + +if not _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] then + _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] = "1" +end + +newoption { + trigger = "SDL_INSTALL_ROOT", + description = "Equivalent to the ./configure --prefix=<path>", +} + +newoption { + trigger = "SDL_PKGCONFIG_PATH", + description = "Location of pkg-config command that knows about SDL. Useful for non-root Homebrew installs on Linux.", +} + +newoption { + trigger = "SDL_FRAMEWORK_PATH", + description = "Location of SDL framework for custom OS X installations", +} + +-- SDL 3's framework now contains all Apple platforms in a single framework, so we need to +-- specifically ask for the macOS version. +if not _OPTIONS["SDL_FRAMEWORK_PATH"] then + _OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/SDL3.xcframework/macos-arm64_x86_64/" +end + +newoption { + trigger = "USE_LIBSDL", + description = "Use SDL library on OS (rather than framework/dll)", + allowed = { + { "0", "Use framework/dll" }, + { "1", "Use library" }, + }, +} + +if not _OPTIONS["USE_LIBSDL"] then + _OPTIONS["USE_LIBSDL"] = "0" +end + + +BASE_TARGETOS = "unix" +SDLOS_TARGETOS = "unix" +if _OPTIONS["targetos"]=="windows" then + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" +elseif _OPTIONS["targetos"]=="macosx" then + SDLOS_TARGETOS = "macosx" +end + +if BASE_TARGETOS=="unix" then + if _OPTIONS["targetos"]=="macosx" then + local os_version = str_to_version(backtick("sw_vers -productVersion")) + + links { + "Cocoa.framework", + } + linkoptions { + "-framework QuartzCore", + "-framework OpenGL", + "-framework IOKit", + "-rpath " .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + + + if os_version>=101100 then + linkoptions { + "-weak_framework Metal", + } + end + if _OPTIONS["USE_LIBSDL"]~="1" then + linkoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + links { + "SDL3.framework", + } + else + local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) + end + else + if _OPTIONS["NO_X11"]=="1" then + _OPTIONS["USE_QTDEBUG"] = "0" + else + libdirs { + "/usr/X11/lib", + "/usr/X11R6/lib", + "/usr/openwin/lib", + } + end + local str = backtick(sdlconfigcmd() .. " --libs") + addlibfromstring(str) + addoptionsfromstring(str) + + if _OPTIONS["targetos"]~="haiku" and _OPTIONS["targetos"]~="android" then + links { + "m", + "pthread", + } + if _OPTIONS["targetos"]=="solaris" then + links { + "socket", + "nsl", + } + elseif _OPTIONS["targetos"]~="asmjs" then + links { + "util", + } + end + end + end +end + +project ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("sdl3_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + configuration { "linux-* or freebsd" } + buildoptions { + "-fPIC", + } + configuration { } + + qtdebuggerbuild() + +project ("osd_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .._OPTIONS["subtarget"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("sdl3_cfg.lua") + osdmodulesbuild() + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/osd/sdl3", + } + + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "src/osd/modules/debugger/debugosx.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugcommandhistory.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugcommandhistory.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugconsole.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugconsole.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugwindowhandler.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugwindowhandler.h", + MAME_DIR .. "src/osd/modules/debugger/osx/deviceinfoviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/deviceinfoviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/devicesviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/devicesviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/exceptionpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/exceptionpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/pointsviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/pointsviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/registerpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/registerpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/registersview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/registersview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugosx.h", + } + end + + files { + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/sdl3/osdsdl.cpp", + MAME_DIR .. "src/osd/sdl3/osdsdl.h", + MAME_DIR .. "src/osd/sdl3/sdlmain.cpp", + MAME_DIR .. "src/osd/sdl3/sdlopts.cpp", + MAME_DIR .. "src/osd/sdl3/sdlopts.h", + MAME_DIR .. "src/osd/sdl3/sdlprefix.h", + MAME_DIR .. "src/osd/sdl3/video.cpp", + MAME_DIR .. "src/osd/sdl3/window.cpp", + MAME_DIR .. "src/osd/sdl3/window.h", + } + +project ("ocore_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("sdl3_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/sdl3", + } + + files { + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/osdfile.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/lib/osdlib_" .. SDLOS_TARGETOS .. ".cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib.h", + } + + if BASE_TARGETOS=="unix" then + files { + MAME_DIR .. "src/osd/modules/file/posixdir.cpp", + MAME_DIR .. "src/osd/modules/file/posixfile.cpp", + MAME_DIR .. "src/osd/modules/file/posixfile.h", + MAME_DIR .. "src/osd/modules/file/posixptty.cpp", + MAME_DIR .. "src/osd/modules/file/posixsocket.cpp", + } + elseif BASE_TARGETOS=="win32" then + includedirs { + MAME_DIR .. "src/osd/windows", + } + files { + MAME_DIR .. "src/osd/modules/file/windir.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.h", + MAME_DIR .. "src/osd/modules/file/winptty.cpp", + MAME_DIR .. "src/osd/modules/file/winsocket.cpp", + MAME_DIR .. "src/osd/windows/winutil.cpp", -- FIXME put the necessary functions somewhere more appropriate? + MAME_DIR .. "src/osd/windows/winutil.h", + } + else + files { + MAME_DIR .. "src/osd/modules/file/stdfile.cpp", + } + end + + diff --git a/scripts/src/osd/sdl3_cfg.lua b/scripts/src/osd/sdl3_cfg.lua new file mode 100644 index 00000000000..535cf749005 --- /dev/null +++ b/scripts/src/osd/sdl3_cfg.lua @@ -0,0 +1,167 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +dofile('modules.lua') + +forcedincludes { + MAME_DIR .. "src/osd/sdl/sdlprefix.h" +} + +if _OPTIONS["USE_TAPTUN"]=="1" or _OPTIONS["USE_PCAP"]=="1" then + defines { + "USE_NETWORK", + } + if _OPTIONS["USE_TAPTUN"]=="1" then + defines { + "OSD_NET_USE_TAPTUN", + } + end + if _OPTIONS["USE_PCAP"]=="1" then + defines { + "OSD_NET_USE_PCAP", + } + end +end + +if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + includedirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"include"), + } +end + +if _OPTIONS["SDL_INI_PATH"]~=nil then + defines { + "'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'", + } +end + +if _OPTIONS["NO_X11"]=="1" then + defines { + "SDLMAME_NO_X11", + } +else + defines { + "SDLMAME_X11", + } + includedirs { + "/usr/X11/include", + "/usr/X11R6/include", + "/usr/openwin/include", + } +end + +if _OPTIONS["NO_USE_XINPUT"]=="1" then + defines { + "USE_XINPUT=0", + } +else + defines { + "USE_XINPUT=1", + "USE_XINPUT_DEBUG=0", + } +end + +if _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"]=="1" then + defines { + "USE_XINPUT_WII_LIGHTGUN_HACK=0", + } +else + defines { + "USE_XINPUT_WII_LIGHTGUN_HACK=1", + } +end + +if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then + buildoptions { + backtick(pkgconfigcmd() .. " --cflags alsa"), + } +end + +defines { + "SDLMAME_SDL3=1", +} + +defines { + "OSD_SDL", +} + +if BASE_TARGETOS=="unix" then + defines { + "SDLMAME_UNIX", + } + if _OPTIONS["targetos"]=="macosx" then + if _OPTIONS["USE_LIBSDL"]~="1" then + buildoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + else + defines { + "MACOSX_USE_LIBSDL", + } + buildoptions { + backtick(sdlconfigcmd() .. " --cflags | sed 's:/SDL3::'"), + } + end + else + buildoptions { + backtick(sdlconfigcmd() .. " --cflags | sed 's:/SDL3::'"), + } + if _OPTIONS["targetos"]~="asmjs" then + buildoptions { + backtick(pkgconfigcmd() .. " --cflags fontconfig"), + } + end + end +end + +if _OPTIONS["targetos"]=="windows" then + configuration { "mingw* or vs*" } + defines { + "UNICODE", + "_UNICODE", + "_WIN32_WINNT=0x0600", + "WIN32_LEAN_AND_MEAN", + "NOMINMAX", + } + + configuration { } + +elseif _OPTIONS["targetos"]=="linux" then + if _OPTIONS["QT_HOME"]~=nil then + buildoptions { + "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"), + } + else + buildoptions { + backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + } + end +elseif _OPTIONS["targetos"]=="macosx" then + defines { + "SDLMAME_MACOSX", + "SDLMAME_DARWIN", + } +elseif _OPTIONS["targetos"]=="freebsd" then + buildoptions { + -- /usr/local/include is not considered a system include director on FreeBSD. GL.h resides there and throws warnings + "-isystem /usr/local/include", + } +end + +configuration { "osx*" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/osx", + } + +configuration { "freebsd" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/freebsd", + } + +configuration { "netbsd" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/freebsd", + } + +configuration { } + diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index ac300261ce8..f65fae4f513 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -28,6 +28,12 @@ function maintargetosdoptions(_target,_subtarget) } end + if _OPTIONS["USE_SDL3"] == "1" then + links { + "SDL3.dll", + } + end + links { "comctl32", "comdlg32", @@ -42,10 +48,23 @@ end newoption { trigger = "USE_SDL", - description = "Enable SDL sound output", + description = "Enable SDL2 sound output", + allowed = { + { "0", "Disable SDL2 sound output" }, + { "1", "Enable SDL2 sound output" }, + }, +} + +if not _OPTIONS["USE_SDL"] then + _OPTIONS["USE_SDL"] = "0" +end + +newoption { + trigger = "USE_SDL3", + description = "Enable SDL3 sound output", allowed = { - { "0", "Disable SDL sound output" }, - { "1", "Enable SDL sound output" }, + { "0", "Disable SDL3 sound output" }, + { "1", "Enable SDL3 sound output" }, }, } diff --git a/scripts/src/osd/windows_cfg.lua b/scripts/src/osd/windows_cfg.lua index 98893440f9f..fd144ae3f3e 100644 --- a/scripts/src/osd/windows_cfg.lua +++ b/scripts/src/osd/windows_cfg.lua @@ -58,7 +58,16 @@ if _OPTIONS["USE_SDL"]=="1" then "USE_SDL_SOUND", } else + if _OPTIONS["USE_SDL3"]=="1" then defines { - "USE_SDL=0", + "SDLMAME_SDL3=1", + "USE_XINPUT=0", + "USE_SDL3=1", + "USE_SDL_SOUND", } + else + defines { + "USE_SDL=0", + } + end end diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index e2340724e0c..7d0e85039cd 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -794,12 +794,11 @@ if (_OPTIONS["osd"] == "sdl") then if _OPTIONS["USE_LIBSDL"]~="1" then configuration { "mingw*"} links { - "SDL2main", - "SDL2", + "SDL3", } configuration { "vs*" } links { - "SDL2", + "SDL3", "imm32", "version", } |
