summaryrefslogtreecommitdiffstatshomepage
path: root/scripts/src/osd/sdl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/src/osd/sdl.lua')
-rw-r--r--scripts/src/osd/sdl.lua86
1 files changed, 61 insertions, 25 deletions
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",