* Take more link dependencies caused by OSD out of genie.lua

* Always dynamically link SDL on Windows
* Fix SDL1 build on Windows
This commit is contained in:
Vas Crabb 2015-04-04 18:25:04 +11:00
parent 3a15dfc2d8
commit 73f53bb15e
6 changed files with 49 additions and 37 deletions

View File

@ -53,7 +53,7 @@ newoption {
newoption { newoption {
trigger = "osd", trigger = "osd",
description = "Choose target OSD", description = "Choose OSD layer implementation",
} }
newoption { newoption {
@ -781,26 +781,12 @@ configuration { "mingw*" }
"-static-libgcc", "-static-libgcc",
"-static-libstdc++", "-static-libstdc++",
} }
if _OPTIONS["osd"]=="sdl" then
links {
"SDL2",
"imm32",
"version",
"ole32",
"oleaut32",
}
end
links { links {
"user32", "user32",
"gdi32",
"dsound",
"dxguid",
"winmm", "winmm",
"advapi32", "advapi32",
"comctl32",
"shlwapi", "shlwapi",
"wsock32", "wsock32",
"comdlg32",
} }
configuration { "vs*" } configuration { "vs*" }
@ -813,15 +799,10 @@ configuration { "vs*" }
} }
links { links {
"user32", "user32",
"gdi32",
"dsound",
"dxguid",
"winmm", "winmm",
"advapi32", "advapi32",
"comctl32",
"shlwapi", "shlwapi",
"wsock32", "wsock32",
"comdlg32",
} }
buildoptions { buildoptions {

View File

@ -181,6 +181,14 @@ function osdmodulestargetconf()
end end
end end
if _OPTIONS["targetos"]=="windows" then
links {
"gdi32",
"dsound",
"dxguid",
}
end
end end

View File

@ -43,6 +43,16 @@ function maintargetosdoptions(_target)
end end
if _OPTIONS["targetos"]=="windows" then if _OPTIONS["targetos"]=="windows" then
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
links {
"SDL2.dll",
}
else
links {
"SDL.dll",
}
end
configuration { "mingw*" } configuration { "mingw*" }
linkoptions{ linkoptions{
"-municode", "-municode",
@ -59,10 +69,6 @@ function maintargetosdoptions(_target)
libdirs { libdirs {
path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64")
} }
configuration { "vs*" }
links {
"SDL2",
}
configuration {} configuration {}
elseif _OPTIONS["targetos"]=="haiku" then elseif _OPTIONS["targetos"]=="haiku" then
links { links {
@ -282,13 +288,6 @@ elseif BASE_TARGETOS=="os2" then
} }
end end
configuration { "mingw*" }
linkoptions {
"-static"
}
configuration { }
project ("osd_" .. _OPTIONS["osd"]) project ("osd_" .. _OPTIONS["osd"])
uuid (os.uuid("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["targetos"]=="windows" then
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
links {
"SDL2.dll",
}
else
links {
"SDL.dll",
}
end
linkoptions{ linkoptions{
"-municode", "-municode",
} }

View File

@ -28,6 +28,11 @@ function maintargetosdoptions(_target)
} }
end end
links {
"comctl32",
"comdlg32",
}
local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc" local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc"
if os.isfile(rcfile) then if os.isfile(rcfile) then

View File

@ -12,6 +12,11 @@
#ifndef __SDLVIDEO__ #ifndef __SDLVIDEO__
#define __SDLVIDEO__ #define __SDLVIDEO__
#if defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include "osdsdl.h" #include "osdsdl.h"
//============================================================ //============================================================

View File

@ -9,6 +9,11 @@
// //
//============================================================ //============================================================
#ifdef SDLMAME_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
// standard SDL headers // standard SDL headers
#include "sdlinc.h" #include "sdlinc.h"
@ -60,7 +65,7 @@
// minimum window dimension // minimum window dimension
#define MIN_WINDOW_DIM 200 #define MIN_WINDOW_DIM 200
//#ifndef SDLMAME_WIN32 #ifndef SDLMAME_WIN32
#define WMSZ_TOP (0) #define WMSZ_TOP (0)
#define WMSZ_BOTTOM (1) #define WMSZ_BOTTOM (1)
#define WMSZ_BOTTOMLEFT (2) #define WMSZ_BOTTOMLEFT (2)
@ -69,7 +74,7 @@
#define WMSZ_TOPLEFT (5) #define WMSZ_TOPLEFT (5)
#define WMSZ_TOPRIGHT (6) #define WMSZ_TOPRIGHT (6)
#define WMSZ_RIGHT (7) #define WMSZ_RIGHT (7)
//#endif #endif
//============================================================ //============================================================
// GLOBAL VARIABLES // GLOBAL VARIABLES