summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/src/osd/sdl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/src/osd/sdl.lua')
-rw-r--r--scripts/src/osd/sdl.lua154
1 files changed, 58 insertions, 96 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 10aa9940c52..cc31fa52008 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -37,6 +37,12 @@ function maintargetosdoptions(_target,_subtarget)
end
end
+ if _OPTIONS["USE_WAYLAND"]=="1" then
+ links {
+ "wayland-egl"
+ }
+ end
+
if _OPTIONS["NO_USE_XINPUT"]~="1" then
links {
"Xext",
@@ -54,14 +60,11 @@ function maintargetosdoptions(_target,_subtarget)
end
if _OPTIONS["targetos"]=="windows" then
- if _OPTIONS["with-bundled-sdl2"]~=nil then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
configuration { "mingw*"}
links {
+ "SDL2main",
"SDL2",
- "imm32",
- "version",
- "ole32",
- "oleaut32",
}
configuration { "vs*" }
links {
@@ -71,35 +74,22 @@ function maintargetosdoptions(_target,_subtarget)
}
configuration { }
else
- if _OPTIONS["USE_LIBSDL"]~="1" then
- configuration { "mingw*"}
- links {
- "SDL2main",
- "SDL2",
- }
- configuration { "vs*" }
- links {
- "SDL2",
- "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 { }
+ 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
@@ -116,15 +106,6 @@ function maintargetosdoptions(_target,_subtarget)
"ole32",
}
configuration { }
-
- if _OPTIONS["targetos"]=="macosx" then
- if _OPTIONS["with-bundled-sdl2"]~=nil then
- links {
- "SDL2",
- }
- end
- end
-
end
@@ -159,7 +140,7 @@ newoption {
}
if not _OPTIONS["NO_X11"] then
- if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" 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"
@@ -167,6 +148,15 @@ if not _OPTIONS["NO_X11"] then
end
newoption {
+ trigger = "USE_WAYLAND",
+ description = "Use Wayland",
+ allowed = {
+ { "0", "Do not use Wayland (use XWayland or X11)" },
+ { "1", "Use Wayland" },
+ },
+}
+
+newoption {
trigger = "NO_USE_XINPUT",
description = "Disable use of Xinput",
allowed = {
@@ -176,7 +166,7 @@ newoption {
}
if not _OPTIONS["NO_USE_XINPUT"] then
- if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" 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"
@@ -251,11 +241,6 @@ elseif _OPTIONS["targetos"]=="macosx" then
SDLOS_TARGETOS = "macosx"
end
-if _OPTIONS["with-bundled-sdl2"]~=nil then
- includedirs {
- GEN_DIR .. "includes",
- }
-end
if BASE_TARGETOS=="unix" then
if _OPTIONS["targetos"]=="macosx" then
local os_version = str_to_version(backtick("sw_vers -productVersion"))
@@ -266,6 +251,8 @@ if BASE_TARGETOS=="unix" then
linkoptions {
"-framework QuartzCore",
"-framework OpenGL",
+ "-framework IOKit",
+ "-rpath " .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
@@ -274,28 +261,17 @@ if BASE_TARGETOS=="unix" then
"-weak_framework Metal",
}
end
- if _OPTIONS["with-bundled-sdl2"]~=nil then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
linkoptions {
- "-framework AudioUnit",
- "-framework CoreAudio",
- "-framework Carbon",
- "-framework ForceFeedback",
- "-framework IOKit",
- "-framework CoreVideo",
+ "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
+ }
+ links {
+ "SDL2.framework",
}
else
- if _OPTIONS["USE_LIBSDL"]~="1" then
- linkoptions {
- "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
- }
- links {
- "SDL2.framework",
- }
- else
- local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'")
- addlibfromstring(str)
- addoptionsfromstring(str)
- end
+ local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
else
if _OPTIONS["NO_X11"]=="1" then
@@ -307,17 +283,9 @@ if BASE_TARGETOS=="unix" then
"/usr/openwin/lib",
}
end
- if _OPTIONS["with-bundled-sdl2"]~=nil then
- if _OPTIONS["targetos"]~="android" then
- links {
- "SDL2",
- }
- end
- else
- local str = backtick(sdlconfigcmd() .. " --libs")
- addlibfromstring(str)
- addoptionsfromstring(str)
- end
+ local str = backtick(sdlconfigcmd() .. " --libs")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
if _OPTIONS["targetos"]~="haiku" and _OPTIONS["targetos"]~="android" then
links {
@@ -380,12 +348,6 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl",
}
- if _OPTIONS["targetos"]=="windows" then
- files {
- MAME_DIR .. "src/osd/windows/main.cpp",
- }
- end
-
if _OPTIONS["targetos"]=="macosx" then
files {
MAME_DIR .. "src/osd/modules/debugger/debugosx.mm",
@@ -419,6 +381,8 @@ project ("osd_" .. _OPTIONS["osd"])
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",
@@ -428,23 +392,20 @@ project ("osd_" .. _OPTIONS["osd"])
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/sdl/osdsdl.cpp",
MAME_DIR .. "src/osd/sdl/osdsdl.h",
- MAME_DIR .. "src/osd/sdl/sdlprefix.h",
MAME_DIR .. "src/osd/sdl/sdlmain.cpp",
- MAME_DIR .. "src/osd/osdepend.h",
+ MAME_DIR .. "src/osd/sdl/sdlopts.cpp",
+ MAME_DIR .. "src/osd/sdl/sdlopts.h",
+ MAME_DIR .. "src/osd/sdl/sdlprefix.h",
MAME_DIR .. "src/osd/sdl/video.cpp",
MAME_DIR .. "src/osd/sdl/window.cpp",
MAME_DIR .. "src/osd/sdl/window.h",
- MAME_DIR .. "src/osd/modules/osdwindow.cpp",
- MAME_DIR .. "src/osd/modules/osdwindow.h",
- MAME_DIR .. "src/osd/modules/render/drawsdl.cpp",
- }
- files {
- MAME_DIR .. "src/osd/modules/render/draw13.cpp",
- MAME_DIR .. "src/osd/modules/render/blit13.h",
}
-
project ("ocore_" .. _OPTIONS["osd"])
targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"])
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
@@ -467,6 +428,7 @@ project ("ocore_" .. _OPTIONS["osd"])
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",
@@ -480,7 +442,6 @@ project ("ocore_" .. _OPTIONS["osd"])
if BASE_TARGETOS=="unix" then
files {
MAME_DIR .. "src/osd/modules/file/posixdir.cpp",
- MAME_DIR .. "src/osd/modules/file/posixdomain.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",
@@ -496,7 +457,8 @@ project ("ocore_" .. _OPTIONS["osd"])
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.cpp", -- FIXME put the necessary functions somewhere more appropriate?
+ MAME_DIR .. "src/osd/windows/winutil.h",
}
else
files {