diff options
author | 2015-03-31 18:34:57 +1100 | |
---|---|---|
committer | 2015-03-31 20:46:51 +1100 | |
commit | ea348ff9f1f8e57ba4be2f3a4dc597fdcc01b1c1 (patch) | |
tree | e6bb12f804b0df8d9aca12d8392c79509568b5be /scripts/src/osd/sdl.lua | |
parent | 49545f9e843d9336cb8241380fbf4194eae2767e (diff) |
Bring back some SDL OSD configurability (WIP)
Diffstat (limited to 'scripts/src/osd/sdl.lua')
-rw-r--r-- | scripts/src/osd/sdl.lua | 233 |
1 files changed, 189 insertions, 44 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 1942f70bc73..1a5d30bf2ea 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -1,4 +1,18 @@ function maintargetosdoptions(_target) + if _OPTIONS["NO_X11"]~="1" then + links { + "X11", + "Xinerama", + } + end + + if _OPTIONS["NO_USE_XINPUT"]~="1" then + links { + "Xext", + "Xi", + } + end + if _OPTIONS["targetos"]=="windows" then linkoptions{ "-municode", @@ -13,8 +27,7 @@ function maintargetosdoptions(_target) "QtCore4", } end - end - if _OPTIONS["targetos"]=="linux" then + elseif _OPTIONS["targetos"]=="linux" then if (USE_QT == 1) then links { "QtGui", @@ -34,6 +47,105 @@ function maintargetosdoptions(_target) end +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"]=="emscripten" or _OPTIONS["targetos"]=="os2" 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 + _OPTIONS["NO_USE_XINPUT"] = "1" +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 = "SDL_INSTALL_ROOT", + description = "Equivalent to the ./configure --prefix=<path>", +} + +newoption { + trigger = "SDL_FRAMEWORK_PATH", + description = "Location of SDL framework for custom OS X installations", +} + +if not _OPTIONS["SDL_FRAMEWORK_PATH"] then + _OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/" +end + +newoption { + trigger = "MACOSX_USE_LIBSDL", + description = "Use SDL library on OS (rather than framework)", + allowed = { + { "0", "Use framework" }, + { "1", "Use library" }, + }, +} + +if not _OPTIONS["MACOSX_USE_LIBSDL"] then + _OPTIONS["MACOSX_USE_LIBSDL"] = "0" +end + + +if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then + links { + "X11" + } +end + +if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then + buildoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + linkoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2.framework", + } + else + links { + "SDL.framework", + } + end +end + configuration { "mingw*" } linkoptions { "-Wl,--allow-multiple-definition", @@ -78,7 +190,6 @@ project ("osd_" .. _OPTIONS["osd"]) if _OPTIONS["targetos"]=="macosx" then files { - --MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m", MAME_DIR .. "src/osd/modules/debugger/debugosx.m", MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.m", MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.m", @@ -98,6 +209,12 @@ project ("osd_" .. _OPTIONS["osd"]) MAME_DIR .. "src/osd/modules/debugger/osx/registersview.m", MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.m", } + if _OPTIONS["SDL_LIBVER"]=="sdl" then + -- SDLMain_tmpl isn't necessary for SDL2 + files { + MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m", + } + end end files { @@ -107,20 +224,36 @@ project ("osd_" .. _OPTIONS["osd"]) MAME_DIR .. "src/osd/sdl/window.c", MAME_DIR .. "src/osd/sdl/output.c", MAME_DIR .. "src/osd/sdl/watchdog.c", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.c", MAME_DIR .. "src/osd/modules/render/drawsdl.c", - --ifeq ($(SDL_LIBVER),sdl2) - MAME_DIR .. "src/osd/modules/render/draw13.c", - --endif + MAME_DIR .. "src/osd/modules/render/drawogl.c", MAME_DIR .. "src/osd/modules/debugger/none.c", MAME_DIR .. "src/osd/modules/debugger/debugint.c", MAME_DIR .. "src/osd/modules/debugger/debugwin.c", MAME_DIR .. "src/osd/modules/debugger/debugqt.c", - MAME_DIR .. "src/osd/modules/render/drawogl.c", MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c", MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c", + MAME_DIR .. "src/osd/modules/font/font_sdl.c", + MAME_DIR .. "src/osd/modules/font/font_windows.c", + MAME_DIR .. "src/osd/modules/font/font_osx.c", + MAME_DIR .. "src/osd/modules/font/font_none.c", + MAME_DIR .. "src/osd/modules/netdev/taptun.c", + MAME_DIR .. "src/osd/modules/netdev/pcap.c", + MAME_DIR .. "src/osd/modules/netdev/none.c", + MAME_DIR .. "src/osd/modules/midi/portmidi.c", + MAME_DIR .. "src/osd/modules/midi/none.c", + MAME_DIR .. "src/osd/modules/sound/js_sound.c", + MAME_DIR .. "src/osd/modules/sound/direct_sound.c", + MAME_DIR .. "src/osd/modules/sound/sdl_sound.c", + MAME_DIR .. "src/osd/modules/sound/none.c", } + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + files { + MAME_DIR .. "src/osd/modules/render/draw13.c", + } + end - if (USE_QT == 1) then + if USE_QT == 1 then files { MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.c", MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.c", @@ -144,29 +277,13 @@ project ("osd_" .. _OPTIONS["osd"]) } end - if (USE_BGFX == 1) then + if USE_BGFX == 1 then files { MAME_DIR .. "src/osd/modules/render/drawbgfx.c", } end - files { - MAME_DIR .. "src/osd/modules/lib/osdobj_common.c", - MAME_DIR .. "src/osd/modules/font/font_sdl.c", - MAME_DIR .. "src/osd/modules/font/font_windows.c", - MAME_DIR .. "src/osd/modules/font/font_osx.c", - MAME_DIR .. "src/osd/modules/font/font_none.c", - MAME_DIR .. "src/osd/modules/netdev/taptun.c", - MAME_DIR .. "src/osd/modules/netdev/pcap.c", - MAME_DIR .. "src/osd/modules/netdev/none.c", - MAME_DIR .. "src/osd/modules/midi/portmidi.c", - MAME_DIR .. "src/osd/modules/midi/none.c", - MAME_DIR .. "src/osd/modules/sound/js_sound.c", - MAME_DIR .. "src/osd/modules/sound/direct_sound.c", - MAME_DIR .. "src/osd/modules/sound/sdl_sound.c", - MAME_DIR .. "src/osd/modules/sound/none.c", - } - + project ("ocore_" .. _OPTIONS["osd"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) kind "StaticLib" @@ -189,24 +306,6 @@ project ("ocore_" .. _OPTIONS["osd"]) MAME_DIR .. "src/osd/sdl", } - if _OPTIONS["targetos"]=="linux" then - BASE_TARGETOS = "unix" - SDLOS_TARGETOS = "unix" - SYNC_IMPLEMENTATION = "tc" - end - - if _OPTIONS["targetos"]=="windows" then - BASE_TARGETOS = "win32" - SDLOS_TARGETOS = "win32" - SYNC_IMPLEMENTATION = "windows" - end - - if _OPTIONS["targetos"]=="macosx" then - BASE_TARGETOS = "unix" - SDLOS_TARGETOS = "macosx" - SYNC_IMPLEMENTATION = "ntc" - end - files { MAME_DIR .. "src/osd/strconv.c", MAME_DIR .. "src/osd/sdl/sdldir.c", @@ -228,3 +327,49 @@ project ("ocore_" .. _OPTIONS["osd"]) MAME_DIR .. "src/osd/sdl/osxutils.m", } end + + +-------------------------------------------------- +-- testkeys +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("testkeys") + uuid ("744cec21-c3b6-4d69-93cb-6811fed0ffe3") + kind "ConsoleApp" + + options { + "ForceCPP", + } + + dofile("sdl_cfg.lua") + + includedirs { + MAME_DIR .. "src/lib/util", + } + targetdir(MAME_DIR) + + links { + "ocore_" .. _OPTIONS["osd"], + } + + includeosd() + + files { + MAME_DIR .. "src/osd/sdl/testkeys.c", + } + + if _OPTIONS["targetos"]=="windows" then + linkoptions{ + "-municode", + } + files { + MAME_DIR .. "src/osd/sdl/main.c", + } + 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.m", + } + end +end |