summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-02-18 14:26:10 +1100
committer Vas Crabb <vas@vastheman.com>2019-02-18 14:28:00 +1100
commit176ba64b260e32e792f7a6381e8bcd112f1ea415 (patch)
tree16bb11a9151c91032ca7d60e95f385cc5b1e106f
parent058f7c0ae3dfc60f135643635a559005af897c46 (diff)
attempt to fix testkeys linking in more configurations (nw)
-rw-r--r--scripts/src/osd/sdl.lua2
-rw-r--r--scripts/src/tools.lua116
2 files changed, 82 insertions, 36 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index f94f0f35613..28e126ecee3 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -91,11 +91,11 @@ function maintargetosdoptions(_target,_subtarget)
libdirs {
path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64")
}
+ configuration { }
end
links {
"psapi",
}
- configuration {}
elseif _OPTIONS["targetos"]=="haiku" then
links {
"network",
diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua
index e1e1081a203..157cbde1e7e 100644
--- a/scripts/src/tools.lua
+++ b/scripts/src/tools.lua
@@ -797,46 +797,92 @@ end
--------------------------------------------------
if (_OPTIONS["osd"] == "sdl") then
- project("testkeys")
- uuid ("b3f5a5b8-3203-11e9-93e4-670b4f4e359d")
- kind "ConsoleApp"
+ project("testkeys")
+ uuid ("b3f5a5b8-3203-11e9-93e4-670b4f4e359d")
+ kind "ConsoleApp"
- flags {
- "Symbols", -- always include minimum symbols for executables
- }
+ flags {
+ "Symbols", -- always include minimum symbols for executables
+ }
- if _OPTIONS["SEPARATE_BIN"]~="1" then
- targetdir(MAME_DIR)
- end
+ if _OPTIONS["SEPARATE_BIN"]~="1" then
+ targetdir(MAME_DIR)
+ end
- if _OPTIONS["targetos"] == "macosx" then
- links {
- "ocore_" .. _OPTIONS["osd"],
- ext_lib("utf8proc"),
- }
- else
- links {
- "SDL2",
- "SDL2main",
- "ocore_" .. _OPTIONS["osd"],
- ext_lib("utf8proc"),
- }
- end
+ links {
+ "ocore_" .. _OPTIONS["osd"],
+ ext_lib("utf8proc"),
+ }
+
+ if _OPTIONS["targetos"]=="windows" then
+ if _OPTIONS["with-bundled-sdl2"]~=nil then
+ configuration { "mingw*"}
+ links {
+ "SDL2",
+ "Imm32",
+ "Version",
+ "Ole32",
+ "OleAut32",
+ }
+ configuration { "vs*" }
+ links {
+ "SDL2",
+ "Imm32",
+ "Version",
+ }
+ configuration { }
+ else
+ if _OPTIONS["USE_LIBSDL"]~="1" then
+ configuration { "mingw*"}
+ links {
+ "SDL2main",
+ "SDL2",
+ }
+ 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
+ end
+
+ if BASE_TARGETOS=="unix" then
+ if _OPTIONS["with-bundled-sdl2"]~=nil then
+ links {
+ "SDL2",
+ }
+ end
+ end
- dofile("osd/sdl_cfg.lua")
+ dofile("osd/sdl_cfg.lua")
- includedirs {
- MAME_DIR .. "src/osd",
- }
+ includedirs {
+ MAME_DIR .. "src/osd",
+ }
- files {
- MAME_DIR .. "src/tools/testkeys.cpp",
- }
-
- configuration { "mingw*" or "vs*" }
- targetextension ".exe"
-
- configuration { }
+ files {
+ MAME_DIR .. "src/tools/testkeys.cpp",
+ }
- strip()
+ configuration { "mingw*" or "vs*" }
+ targetextension ".exe"
+
+ configuration { }
+
+ strip()
end