summaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genie.lua24
-rw-r--r--scripts/src/3rdparty.lua20
-rw-r--r--scripts/src/emu.lua4
-rw-r--r--scripts/src/main.lua23
-rw-r--r--scripts/src/osd/sdl.lua41
-rw-r--r--scripts/src/osd/sdl_cfg.lua2
6 files changed, 86 insertions, 28 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 984196e2af7..02259293cbe 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -54,7 +54,9 @@ function layoutbuildtask(_folder, _name)
end
function precompiledheaders()
- pchheader("emu.h")
+ configuration { "not xcode4" }
+ pchheader("emu.h")
+ configuration { }
end
function addprojectflags()
@@ -442,11 +444,17 @@ configurations {
"Release",
}
-platforms {
- "x32",
- "x64",
- "Native", -- for targets where bitness is not specified
-}
+if _ACTION == "xcode4" then
+ platforms {
+ "Universal",
+ }
+else
+ platforms {
+ "x32",
+ "x64",
+ "Native", -- for targets where bitness is not specified
+ }
+end
language "C++"
@@ -672,7 +680,7 @@ end
"LUA_COMPAT_5_2",
}
- if _ACTION == "gmake" then
+ if _ACTION == "gmake" or _ACTION == "xcode4" then
--we compile C-only to C99 standard with GNU extensions
@@ -1067,7 +1075,7 @@ configuration { "steamlink" }
"EGL_API_FB",
}
-configuration { "osx*" }
+configuration { "osx* or xcode4" }
links {
"pthread",
}
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 04038127dfb..8ef18689e66 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -60,7 +60,7 @@ project "zlib"
local version = str_to_version(_OPTIONS["gcc_version"])
if _OPTIONS["gcc"]~=nil and (string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs")) then
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
if (version >= 30700) then
buildoptions {
"-Wno-shift-negative-value",
@@ -85,7 +85,7 @@ end
"verbose=-1",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
}
@@ -271,7 +271,7 @@ end
"HAVE_CONFIG_H=1",
}
- configuration { "gmake"}
+ configuration { "gmake or xcode4"}
buildoptions_c {
"-Wno-unused-function",
"-O0",
@@ -384,7 +384,7 @@ project "lua"
-- "ForceCPP",
--}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-bad-function-cast"
}
@@ -523,7 +523,7 @@ project "luv"
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-unused-function",
"-Wno-strict-prototypes",
@@ -588,7 +588,7 @@ end
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-bad-function-cast",
"-Wno-undef",
@@ -746,7 +746,7 @@ end
MAME_DIR .. "3rdparty/bx/include/compat/mingw",
}
- configuration { "osx*" }
+ configuration { "osx* or xcode4" }
includedirs {
MAME_DIR .. "3rdparty/bx/include/compat/osx",
}
@@ -761,7 +761,7 @@ end
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions {
"-Wno-uninitialized",
"-Wno-unused-function",
@@ -864,7 +864,7 @@ end
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
"-Wno-bad-function-cast",
@@ -999,7 +999,7 @@ project "uv"
MAME_DIR .. "3rdparty/libuv/src/win",
}
- configuration { "gmake" }
+ configuration { "gmake or xcode4" }
buildoptions_c {
"-Wno-strict-prototypes",
"-Wno-bad-function-cast",
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index 9413b092af7..c4bb8ece0cf 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -16,7 +16,9 @@ kind (LIBTYPE)
addprojectflags()
precompiledheaders()
-
+options {
+ "ArchiveSplit",
+}
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/emu",
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 9873ba269c9..b8125bf1989 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -87,8 +87,21 @@ end
configuration { "asmjs" }
targetextension ".bc"
if os.getenv("EMSCRIPTEN") then
+ local emccopts = ""
+ emccopts = emccopts .. " -O3"
+ emccopts = emccopts .. " -s USE_SDL=2"
+ emccopts = emccopts .. " --memory-init-file 0"
+ emccopts = emccopts .. " -s ALLOW_MEMORY_GROWTH=0"
+ emccopts = emccopts .. " -s TOTAL_MEMORY=268435456"
+ emccopts = emccopts .. " -s DISABLE_EXCEPTION_CATCHING=2"
+ emccopts = emccopts .. " -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\"]'"
+ emccopts = emccopts .. " -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio']\""
+ emccopts = emccopts .. " --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js"
+ emccopts = emccopts .. " --post-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/sdl/emscripten_post.js"
+ emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "bgfx@bgfx"
+ emccopts = emccopts .. " --embed-file " .. _MAKE.esc(MAME_DIR) .. "shaders/gles@shaders/gles"
postbuildcommands {
- os.getenv("EMSCRIPTEN") .. "/emcc -O3 -s DISABLE_EXCEPTION_CATCHING=2 -s USE_SDL=2 --memory-init-file 0 -s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=268435456 -s EXCEPTION_CATCHING_WHITELIST='[\"__ZN15running_machine17start_all_devicesEv\"]' -s EXPORTED_FUNCTIONS=\"['_main', '_malloc', '__Z14js_get_machinev', '__Z9js_get_uiv', '__Z12js_get_soundv', '__ZN10ui_manager12set_show_fpsEb', '__ZNK10ui_manager8show_fpsEv', '__ZN13sound_manager4muteEbh', '_SDL_PauseAudio']\" $(TARGET) -o " .. _MAKE.esc(MAME_DIR) .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".js --pre-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/modules/sound/js_sound.js --post-js " .. _MAKE.esc(MAME_DIR) .. "src/osd/sdl/emscripten_post.js",
+ os.getenv("EMSCRIPTEN") .. "/emcc " .. emccopts .. " $(TARGET) -o " .. _MAKE.esc(MAME_DIR) .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".js",
}
end
@@ -271,8 +284,14 @@ end
"@echo Emitting ".. rctarget .. "vers.rc...",
PYTHON .. " " .. path.translate(MAME_DIR .. "scripts/build/verinfo.py","\\") .. " -r -b " .. rctarget .. " " .. path.translate(MAME_DIR .. "src/version.cpp","\\") .. " > " .. path.translate(GEN_DIR .. "resource/" .. rctarget .. "vers.rc", "\\") ,
}
+
+ if (_OPTIONS["osd"] == "sdl") then
+ configuration { "x64","vs*" }
+ prelinkcommands { "copy " .. path.translate(MAME_DIR .."3rdparty/sdl2/lib/x64/SDL2.dll", "\\") .. " " .. path.translate(MAME_DIR .."SDL2.dll","\\") .. " /Y" }
+ configuration { "x32","vs*" }
+ prelinkcommands { "copy " .. path.translate(MAME_DIR .."3rdparty/sdl2/lib/x86/SDL2.dll", "\\") .. " " .. path.translate(MAME_DIR .."SDL2.dll","\\") .. " /Y" }
+ end
-
configuration { }
debugdir (MAME_DIR)
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index cb5bd6debdc..76947ad777a 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -49,9 +49,24 @@ function maintargetosdoptions(_target,_subtarget)
if _OPTIONS["targetos"]=="windows" then
if _OPTIONS["USE_LIBSDL"]~="1" then
- links {
- "SDL2.dll",
- }
+ configuration { "mingw*"}
+ links {
+ "SDL2.dll",
+ }
+ configuration { "x64","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x64",
+ }
+ configuration { "x32","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x86",
+ }
+
+ configuration { "vs*"}
+ links {
+ "SDL2",
+ }
+ configuration { }
else
local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
addlibfromstring(str)
@@ -488,9 +503,23 @@ if _OPTIONS["with-tools"] then
if _OPTIONS["targetos"] == "windows" then
if _OPTIONS["USE_LIBSDL"]~="1" then
- links {
- "SDL2.dll",
- }
+ configuration { "mingw*"}
+ links {
+ "SDL2.dll",
+ }
+ configuration { "x64","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x64",
+ }
+ configuration { "x32","vs*" }
+ libdirs {
+ MAME_DIR .. "3rdparty/sdl2/lib/x86",
+ }
+ configuration { "vs*"}
+ links {
+ "SDL2",
+ }
+ configuration { }
else
local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'")
addlibfromstring(str)
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index bdeb7274ef1..e3a6f913e75 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -113,7 +113,7 @@ if _OPTIONS["targetos"]=="windows" then
}
configuration { "vs*" }
includedirs {
- path.join(_OPTIONS["SDL_INSTALL_ROOT"],"include")
+ MAME_DIR .. "3rdparty/sdl2/include",
}
configuration { }