diff options
author | 2015-04-04 18:25:04 +1100 | |
---|---|---|
committer | 2015-04-04 18:25:04 +1100 | |
commit | 73f53bb15e363712d097fe59c097de1a1fb9fed0 (patch) | |
tree | 70b159e73ec28ed30fc6635c0df79007318ac031 | |
parent | 3a15dfc2d89ca7d42748ced4582e69e6556c61cd (diff) |
* Take more link dependencies caused by OSD out of genie.lua
* Always dynamically link SDL on Windows
* Fix SDL1 build on Windows
-rw-r--r-- | scripts/genie.lua | 21 | ||||
-rw-r--r-- | scripts/src/osd/modules.lua | 8 | ||||
-rw-r--r-- | scripts/src/osd/sdl.lua | 30 | ||||
-rw-r--r-- | scripts/src/osd/windows.lua | 5 | ||||
-rw-r--r-- | src/osd/sdl/video.h | 5 | ||||
-rw-r--r-- | src/osd/sdl/window.c | 17 |
6 files changed, 49 insertions, 37 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index fb8362791a8..9212b393be3 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -53,7 +53,7 @@ newoption { newoption { trigger = "osd", - description = "Choose target OSD", + description = "Choose OSD layer implementation", } newoption { @@ -781,26 +781,12 @@ configuration { "mingw*" } "-static-libgcc", "-static-libstdc++", } -if _OPTIONS["osd"]=="sdl" then - links { - "SDL2", - "imm32", - "version", - "ole32", - "oleaut32", - } -end links { "user32", - "gdi32", - "dsound", - "dxguid", "winmm", "advapi32", - "comctl32", "shlwapi", "wsock32", - "comdlg32", } configuration { "vs*" } @@ -813,15 +799,10 @@ configuration { "vs*" } } links { "user32", - "gdi32", - "dsound", - "dxguid", "winmm", "advapi32", - "comctl32", "shlwapi", "wsock32", - "comdlg32", } buildoptions { diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index c8e1efee2c9..eac621aaf8b 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -181,6 +181,14 @@ function osdmodulestargetconf() end end + if _OPTIONS["targetos"]=="windows" then + links { + "gdi32", + "dsound", + "dxguid", + } + end + end diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 551b98cb392..578fb17608f 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -43,6 +43,16 @@ function maintargetosdoptions(_target) end if _OPTIONS["targetos"]=="windows" then + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2.dll", + } + else + links { + "SDL.dll", + } + end + configuration { "mingw*" } linkoptions{ "-municode", @@ -59,10 +69,6 @@ function maintargetosdoptions(_target) libdirs { path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") } - configuration { "vs*" } - links { - "SDL2", - } configuration {} elseif _OPTIONS["targetos"]=="haiku" then links { @@ -282,13 +288,6 @@ elseif BASE_TARGETOS=="os2" then } end -configuration { "mingw*" } - linkoptions { - "-static" - } - -configuration { } - project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) @@ -442,6 +441,15 @@ if _OPTIONS["with-tools"] then } if _OPTIONS["targetos"]=="windows" then + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2.dll", + } + else + links { + "SDL.dll", + } + end linkoptions{ "-municode", } diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 3b060f64b55..bdfb2eb57f9 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -28,6 +28,11 @@ function maintargetosdoptions(_target) } end + links { + "comctl32", + "comdlg32", + } + local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc" if os.isfile(rcfile) then diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h index 913116f6b62..862988fe6ac 100644 --- a/src/osd/sdl/video.h +++ b/src/osd/sdl/video.h @@ -12,6 +12,11 @@ #ifndef __SDLVIDEO__ #define __SDLVIDEO__ +#if defined(SDLMAME_WIN32) && !(SDLMAME_SDL2) +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif + #include "osdsdl.h" //============================================================ diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c index e77fa480bb0..d44742c80f6 100644 --- a/src/osd/sdl/window.c +++ b/src/osd/sdl/window.c @@ -9,6 +9,11 @@ // //============================================================ +#ifdef SDLMAME_WIN32 +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif + // standard SDL headers #include "sdlinc.h" @@ -60,16 +65,16 @@ // minimum window dimension #define MIN_WINDOW_DIM 200 -//#ifndef SDLMAME_WIN32 -#define WMSZ_TOP (0) -#define WMSZ_BOTTOM (1) +#ifndef SDLMAME_WIN32 +#define WMSZ_TOP (0) +#define WMSZ_BOTTOM (1) #define WMSZ_BOTTOMLEFT (2) #define WMSZ_BOTTOMRIGHT (3) -#define WMSZ_LEFT (4) +#define WMSZ_LEFT (4) #define WMSZ_TOPLEFT (5) #define WMSZ_TOPRIGHT (6) -#define WMSZ_RIGHT (7) -//#endif +#define WMSZ_RIGHT (7) +#endif //============================================================ // GLOBAL VARIABLES |