summaryrefslogtreecommitdiffstats
path: root/docs/release/scripts/src/osd/sdl.lua
diff options
context:
space:
mode:
author Robbbert <pac0446@bigpond.net.au>2016-02-26 11:05:20 +1100
committer Robbbert <pac0446@bigpond.net.au>2016-02-26 11:05:20 +1100
commitc33749165c7e8181353216925ae9f2558db5b51d (patch)
tree6b0230243965ee3ec8e926242082bbd1f56bacaf /docs/release/scripts/src/osd/sdl.lua
parent60b1a4a750cb059c65eb77b6de7a5fed5f4f457a (diff)
0.171 Release Fileshbmame171
Diffstat (limited to 'docs/release/scripts/src/osd/sdl.lua')
-rw-r--r--docs/release/scripts/src/osd/sdl.lua165
1 files changed, 78 insertions, 87 deletions
diff --git a/docs/release/scripts/src/osd/sdl.lua b/docs/release/scripts/src/osd/sdl.lua
index 6acb5a2d262..76947ad777a 100644
--- a/docs/release/scripts/src/osd/sdl.lua
+++ b/docs/release/scripts/src/osd/sdl.lua
@@ -39,29 +39,38 @@ function maintargetosdoptions(_target,_subtarget)
end
if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2_ttf",
- }
- else
- links {
- "SDL_ttf",
- }
- end
+ links {
+ "SDL2_ttf",
+ }
local str = backtick("pkg-config --libs fontconfig")
addlibfromstring(str)
addoptionsfromstring(str)
end
if _OPTIONS["targetos"]=="windows" then
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2.dll",
- }
+ if _OPTIONS["USE_LIBSDL"]~="1" then
+ configuration { "mingw*"}
+ links {
+ "SDL2.dll",
+ }
+ configuration { "x64","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x64",
+ }
+ configuration { "x32","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x86",
+ }
+
+ configuration { "vs*"}
+ links {
+ "SDL2",
+ }
+ configuration { }
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -93,16 +102,21 @@ function maintargetosdoptions(_target,_subtarget)
configuration { "mingw*" or "vs*" }
targetprefix "sdl"
+ links {
+ "psapi"
+ }
configuration { }
end
function sdlconfigcmd()
- if not _OPTIONS["SDL_INSTALL_ROOT"] then
- return _OPTIONS["SDL_LIBVER"] .. "-config"
+ if _OPTIONS["targetos"]=="asmjs" then
+ return "sdl2-config"
+ elseif not _OPTIONS["SDL_INSTALL_ROOT"] then
+ return _OPTIONS['TOOLCHAIN'] .. "pkg-config sdl2"
else
- return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin",_OPTIONS["SDL_LIBVER"]) .. "-config"
+ return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin","sdl2") .. "-config"
end
end
@@ -148,23 +162,6 @@ if not _OPTIONS["NO_USE_XINPUT"] then
end
newoption {
- trigger = "SDL_LIBVER",
- description = "Choose SDL version",
- allowed = {
- { "sdl", "SDL" },
- { "sdl2", "SDL 2" },
- },
-}
-
-if not _OPTIONS["SDL_LIBVER"] then
- if _OPTIONS["targetos"]=="os2" then
- _OPTIONS["SDL_LIBVER"] = "sdl"
- else
- _OPTIONS["SDL_LIBVER"] = "sdl2"
- end
-end
-
-newoption {
trigger = "SDL2_MULTIAPI",
description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)",
allowed = {
@@ -192,16 +189,16 @@ if not _OPTIONS["SDL_FRAMEWORK_PATH"] then
end
newoption {
- trigger = "MACOSX_USE_LIBSDL",
- description = "Use SDL library on OS (rather than framework)",
+ trigger = "USE_LIBSDL",
+ description = "Use SDL library on OS (rather than framework/dll)",
allowed = {
- { "0", "Use framework" },
+ { "0", "Use framework/dll" },
{ "1", "Use library" },
},
}
-if not _OPTIONS["MACOSX_USE_LIBSDL"] then
- _OPTIONS["MACOSX_USE_LIBSDL"] = "0"
+if not _OPTIONS["USE_LIBSDL"] then
+ _OPTIONS["USE_LIBSDL"] = "0"
end
@@ -235,10 +232,6 @@ elseif _OPTIONS["targetos"]=="os2" then
SYNC_IMPLEMENTATION = "os2"
end
-if _OPTIONS["SDL_LIBVER"]=="sdl" then
- USE_BGFX = 0
-end
-
if BASE_TARGETOS=="unix" then
if _OPTIONS["targetos"]=="macosx" then
local os_version = str_to_version(backtick("sw_vers -productVersion"))
@@ -255,39 +248,27 @@ if BASE_TARGETOS=="unix" then
"-weak_framework Metal",
}
end
- if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
+ if _OPTIONS["USE_LIBSDL"]~="1" then
linkoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- links {
- "SDL2.framework",
- }
- else
- links {
- "SDL.framework",
- }
- end
+ links {
+ "SDL2.framework",
+ }
else
- local str = backtick(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'")
+ 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"
- USE_BGFX = 0
else
libdirs {
"/usr/X11/lib",
"/usr/X11R6/lib",
"/usr/openwin/lib",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- links {
- "X11",
- }
- end
end
local str = backtick(sdlconfigcmd() .. " --libs")
addlibfromstring(str)
@@ -404,13 +385,6 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.h",
MAME_DIR .. "src/osd/modules/debugger/osx/debugosx.h",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.h",
- }
- end
end
files {
@@ -425,18 +399,17 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/video.h",
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/sdl/output.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.cpp",
MAME_DIR .. "src/osd/sdl/watchdog.h",
MAME_DIR .. "src/osd/modules/render/drawsdl.cpp",
}
- if _OPTIONS["SDL_LIBVER"]=="sdl2" then
- files {
- MAME_DIR .. "src/osd/modules/render/draw13.cpp",
- MAME_DIR .. "src/osd/modules/render/blit13.h",
- }
- end
+ files {
+ MAME_DIR .. "src/osd/modules/render/draw13.cpp",
+ MAME_DIR .. "src/osd/modules/render/blit13.h",
+ }
project ("ocore_" .. _OPTIONS["osd"])
@@ -529,14 +502,28 @@ if _OPTIONS["with-tools"] then
}
if _OPTIONS["targetos"] == "windows" then
- if _OPTIONS["SDL_LIBVER"] == "sdl2" then
- links {
- "SDL2.dll",
- }
+ if _OPTIONS["USE_LIBSDL"]~="1" then
+ configuration { "mingw*"}
+ links {
+ "SDL2.dll",
+ }
+ configuration { "x64","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x64",
+ }
+ configuration { "x32","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x86",
+ }
+ configuration { "vs*"}
+ links {
+ "SDL2",
+ }
+ configuration { }
else
- links {
- "SDL.dll",
- }
+ local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
+ addlibfromstring(str)
+ addoptionsfromstring(str)
end
links {
"psapi",
@@ -547,12 +534,14 @@ if _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/main.cpp",
}
- elseif _OPTIONS["targetos"] == "macosx" and _OPTIONS["SDL_LIBVER"] == "sdl" then
- -- SDLMain_tmpl isn't necessary for SDL2
- files {
- MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.mm",
- }
end
+
+ configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+ configuration { }
+
+ strip()
end
@@ -594,4 +583,6 @@ if _OPTIONS["targetos"] == "macosx" and _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/sdl/aueffectutil.mm",
}
+
+ strip()
end