diff options
author | 2016-02-27 18:48:03 +0100 | |
---|---|---|
committer | 2016-02-27 18:48:03 +0100 | |
commit | adfae5ffe5cee3393793efcfc2b188d6da2efaa5 (patch) | |
tree | f63b0f89800b2d0c8d45ce409195682fc13bc6ee /scripts/src | |
parent | 943732712238f8d8bc4fd875a61e66896df25738 (diff) |
make possible to select if bundled SDL2 is used, made mingw and vs compile so far (nw)
Diffstat (limited to 'scripts/src')
-rw-r--r-- | scripts/src/3rdparty.lua | 25 | ||||
-rw-r--r-- | scripts/src/osd/sdl.lua | 86 | ||||
-rw-r--r-- | scripts/src/osd/sdl_cfg.lua | 4 |
3 files changed, 81 insertions, 34 deletions
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 7c0ce4fa807..3a7f8eb6112 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1226,10 +1226,6 @@ project "SDL2" kind "StaticLib" configuration { } - - includedirs { - MAME_DIR .. "3rdparty/SDL2/include", - } files { MAME_DIR .. "3rdparty/SDL2/include/begin_code.h", @@ -1325,7 +1321,6 @@ project "SDL2" MAME_DIR .. "3rdparty/SDL2/src/audio/SDL_wave.h", MAME_DIR .. "3rdparty/SDL2/src/audio/winmm/SDL_winmm.c", MAME_DIR .. "3rdparty/SDL2/src/audio/winmm/SDL_winmm.h", - MAME_DIR .. "3rdparty/SDL2/src/audio/xaudio2/SDL_xaudio2.c", MAME_DIR .. "3rdparty/SDL2/src/core/windows/SDL_directx.h", MAME_DIR .. "3rdparty/SDL2/src/core/windows/SDL_windows.c", MAME_DIR .. "3rdparty/SDL2/src/core/windows/SDL_windows.h", @@ -1519,6 +1514,10 @@ project "SDL2" MAME_DIR .. "3rdparty/SDL2/src/main/windows/version.rc", } configuration { "vs*" } + files { + MAME_DIR .. "3rdparty/SDL2/src/audio/xaudio2/SDL_xaudio2.c", + } + buildoptions { "/wd4200", -- warning C4200: nonstandard extension used: zero-sized array in struct/union "/wd4055", -- warning C4055: 'type cast': from data pointer 'void *' to function pointer 'xxx' @@ -1531,6 +1530,22 @@ project "SDL2" defines { "HAVE_LIBC", } + configuration { "mingw*"} + includedirs { + MAME_DIR .. "3rdparty/SDL2-override/mingw", + MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos", + } + buildoptions_c { + "-Wno-undef", + "-Wno-strict-prototypes", + "-Wno-bad-function-cast", + "-Wno-discarded-qualifiers", + "-Wno-unused-but-set-variable", + } configuration { } + includedirs { + MAME_DIR .. "3rdparty/SDL2/include", + } + end
\ No newline at end of file diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index a95374a2cca..ae7ff14b99c 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -48,10 +48,14 @@ function maintargetosdoptions(_target,_subtarget) end if _OPTIONS["targetos"]=="windows" then - if _OPTIONS["USE_LIBSDL"]~="1" then + if _OPTIONS["with-bundled-sdl2"]~=nil then configuration { "mingw*"} links { - "SDL2.dll", + "SDL2", + "Imm32", + "Version", + "Ole32", + "OleAut32", } configuration { "vs*" } links { @@ -61,14 +65,35 @@ function maintargetosdoptions(_target,_subtarget) } configuration { } else - local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'") - addlibfromstring(str) - addoptionsfromstring(str) + if _OPTIONS["USE_LIBSDL"]~="1" then + configuration { "mingw*"} + links { + "SDL2.dll", + } + 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") + } end links { "psapi", } - configuration { "mingw*-gcc" } linkoptions{ "-municode", @@ -77,14 +102,6 @@ function maintargetosdoptions(_target,_subtarget) flags { "Unicode", } - 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 {} elseif _OPTIONS["targetos"]=="haiku" then links { @@ -221,6 +238,12 @@ elseif _OPTIONS["targetos"]=="macosx" then SDL_NETWORK = "pcap" 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")) @@ -237,17 +260,23 @@ if BASE_TARGETOS=="unix" then "-weak_framework Metal", } end - if _OPTIONS["USE_LIBSDL"]~="1" then - linkoptions { - "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], - } + if _OPTIONS["with-bundled-sdl2"]~=nil then links { - "SDL2.framework", + "SDL2", } else - local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'") - addlibfromstring(str) - addoptionsfromstring(str) + 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 end else if _OPTIONS["NO_X11"]=="1" then @@ -259,9 +288,16 @@ if BASE_TARGETOS=="unix" then "/usr/openwin/lib", } end - local str = backtick(sdlconfigcmd() .. " --libs") - addlibfromstring(str) - addoptionsfromstring(str) + if _OPTIONS["with-bundled-sdl2"]~=nil then + links { + "SDL2", + } + else + local str = backtick(sdlconfigcmd() .. " --libs") + addlibfromstring(str) + addoptionsfromstring(str) + end + if _OPTIONS["targetos"]~="haiku" then links { "m", diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index 0c33a771538..8f9b9d29578 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -111,10 +111,6 @@ if _OPTIONS["targetos"]=="windows" then defines { "MALLOC_DEBUG", } - configuration { "vs*" } - includedirs { - GEN_DIR .. "includes", - } configuration { } elseif _OPTIONS["targetos"]=="linux" then |