From c1ea2817618b621faf2a13415b5f3f66217c5a50 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 17 Feb 2019 14:00:46 +0100 Subject: [PATCH] Fix testkeys compile/link on windows. (nw) --- scripts/genie.lua | 2 +- scripts/src/tools.lua | 74 ++++++++++++++++++++++++------------------ src/tools/testkeys.cpp | 5 +-- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index fd09446d595..0d379308d52 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -87,7 +87,7 @@ function addprojectflags() end if version >= 60000 then buildoptions_cpp { - "-flifetime-dse=1", + --"-flifetime-dse=1", } end end diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index f1f595b8719..e1e1081a203 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -796,37 +796,47 @@ end -- testkeys -------------------------------------------------- -if _OPTIONS["targetos"] ~= "windows" then - if (_OPTIONS["osd"] == "sdl") then - project("testkeys") - uuid ("b3f5a5b8-3203-11e9-93e4-670b4f4e359d") - kind "ConsoleApp" - - flags { - "Symbols", -- always include minimum symbols for executables - } - - if _OPTIONS["SEPARATE_BIN"]~="1" then - targetdir(MAME_DIR) - end - - links { - } - - dofile("osd/sdl_cfg.lua") +if (_OPTIONS["osd"] == "sdl") then + project("testkeys") + uuid ("b3f5a5b8-3203-11e9-93e4-670b4f4e359d") + kind "ConsoleApp" - includedirs { - } - - files { - MAME_DIR .. "src/tools/testkeys.cpp", - } - - configuration { "mingw*" or "vs*" } - targetextension ".exe" - - configuration { } - - strip() + flags { + "Symbols", -- always include minimum symbols for executables + } + + if _OPTIONS["SEPARATE_BIN"]~="1" then + targetdir(MAME_DIR) end -end \ No newline at end of file + + if _OPTIONS["targetos"] == "macosx" then + links { + "ocore_" .. _OPTIONS["osd"], + ext_lib("utf8proc"), + } + else + links { + "SDL2", + "SDL2main", + "ocore_" .. _OPTIONS["osd"], + ext_lib("utf8proc"), + } + end + + dofile("osd/sdl_cfg.lua") + + includedirs { + MAME_DIR .. "src/osd", + } + + files { + MAME_DIR .. "src/tools/testkeys.cpp", + } + + configuration { "mingw*" or "vs*" } + targetextension ".exe" + + configuration { } + + strip() +end diff --git a/src/tools/testkeys.cpp b/src/tools/testkeys.cpp index 473392bd421..ce802d90685 100644 --- a/src/tools/testkeys.cpp +++ b/src/tools/testkeys.cpp @@ -16,6 +16,7 @@ #include #include "SDL2/SDL.h" +#include "osdcore.h" //#include "unicode.h" @@ -303,11 +304,7 @@ static const char * lookup_key_name(const key_lookup_table *kt, int kc) return NULL; } -#ifdef SDLMAME_WIN32 -int utf8_main(int argc, char *argv[]) -#else int main(int argc, char *argv[]) -#endif { SDL_Event event; int quit = 0;