Fix compile on clang 3.7+ on linux (nw)

This commit is contained in:
Miodrag Milanovic 2016-01-08 13:53:57 +01:00
parent 08c8c26b62
commit b3a224378d

View File

@ -15,8 +15,8 @@ end
function addlibfromstring(str) function addlibfromstring(str)
if (str==nil) then return end if (str==nil) then return end
for w in str:gmatch("%S+") do for w in str:gmatch("%S+") do
if string.starts(w,"-l")==true then if string.starts(w,"-l")==true then
links { links {
string.sub(w,3) string.sub(w,3)
} }
@ -26,8 +26,8 @@ end
function addoptionsfromstring(str) function addoptionsfromstring(str)
if (str==nil) then return end if (str==nil) then return end
for w in str:gmatch("%S+") do for w in str:gmatch("%S+") do
if string.starts(w,"-l")==false then if string.starts(w,"-l")==false then
linkoptions { linkoptions {
w w
} }
@ -122,7 +122,7 @@ function osdmodulesbuild()
if _OPTIONS["USE_QTDEBUG"]=="1" then if _OPTIONS["USE_QTDEBUG"]=="1" then
defines { defines {
"USE_QTDEBUG=1", "USE_QTDEBUG=1",
} }
else else
defines { defines {
"USE_QTDEBUG=0", "USE_QTDEBUG=0",
@ -137,6 +137,15 @@ function qtdebuggerbuild()
removeflags { removeflags {
"SingleOutputDir", "SingleOutputDir",
} }
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" }
if (version >= 30700) then
buildoptions {
"-Wno-inconsistent-missing-override",
}
end
end
files { files {
MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp", MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp",
@ -175,7 +184,7 @@ function qtdebuggerbuild()
defines { defines {
"USE_QTDEBUG=1", "USE_QTDEBUG=1",
} }
local MOC = "" local MOC = ""
if (os.is("windows")) then if (os.is("windows")) then
MOC = "moc" MOC = "moc"
@ -185,9 +194,9 @@ function qtdebuggerbuild()
if (QMAKETST=='') then if (QMAKETST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!") print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1) os.exit(1)
end end
MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" MOC = _OPTIONS["QT_HOME"] .. "/bin/moc"
else else
MOCTST = backtick("which moc-qt5 2>/dev/null") MOCTST = backtick("which moc-qt5 2>/dev/null")
if (MOCTST=='') then if (MOCTST=='') then
MOCTST = backtick("which moc 2>/dev/null") MOCTST = backtick("which moc 2>/dev/null")
@ -195,12 +204,12 @@ function qtdebuggerbuild()
if (MOCTST=='') then if (MOCTST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!") print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1) os.exit(1)
end end
MOC = MOCTST MOC = MOCTST
end end
end end
custombuildtask { custombuildtask {
{ MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }}, { MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }}, { MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
@ -211,9 +220,9 @@ function qtdebuggerbuild()
{ MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }}, { MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }}, { MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", { },{ MOC .. "$(MOCINCPATH) $(<) -o $(@)" }}, { MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", { },{ MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
} }
if _OPTIONS["targetos"]=="windows" then if _OPTIONS["targetos"]=="windows" then
configuration { "mingw*" } configuration { "mingw*" }
buildoptions { buildoptions {