Moved MOC handling in lua (nw)

This commit is contained in:
Miodrag Milanovic 2015-04-04 16:42:58 +02:00
parent db3cad9be9
commit 3725b2fdc6
2 changed files with 34 additions and 46 deletions

View File

@ -471,6 +471,7 @@ SCRIPTS = scripts/genie.lua \
scripts/src/bus.lua \
scripts/src/netlist.lua \
scripts/toolchain.lua \
scripts/src/osd/modules.lua \
scripts/target/$(TARGET)/$(SUBTARGET).lua \
$(wildcard src/osd/$(OSD)/$(OSD).mak) \
$(wildcard src/$(TARGET)/$(SUBTARGET).mak)
@ -797,50 +798,10 @@ clean:
-@rm -rf build
$(SILENT) $(MAKE) $(MAKEPARAMS) -C 3rdparty/genie/build/gmake.$(GENIEOS) -f genie.make clean
GEN_FOLDERS := \
$(GENDIR)/$(TARGET)/layout/ \
$(GENDIR)/osd/modules/debugger/qt/
GEN_FOLDERS := $(GENDIR)/$(TARGET)/layout/
LAYOUTS=$(wildcard $(SRC)/$(TARGET)/layout/*.lay)
MOC_FILES=$(wildcard $(SRC)/osd/modules/debugger/qt/*.h)
ifneq ($(USE_QTDEBUG),1)
ifeq ($(TARGETOS),macosx)
MOC_FILES=
endif
ifeq ($(TARGETOS),solaris)
MOC_FILES=
endif
ifeq ($(TARGETOS),haiku)
MOC_FILES=
endif
ifeq ($(TARGETOS),emscripten)
MOC_FILES=
endif
ifeq ($(TARGETOS),os2)
MOC_FILES=
endif
endif
ifeq ($(OS),windows)
MOC = moc
else
MOCTST = $(shell which moc-qt4 2>/dev/null)
ifeq '$(MOCTST)' ''
MOCTST = $(shell which moc 2>/dev/null)
ifeq '$(MOCTST)' ''
ifneq '$(MOC_FILES)' ''
$(error Qt's Meta Object Compiler (moc) wasn't found!)
endif
else
MOC = $(MOCTST)
endif
else
MOC = $(MOCTST)
endif
endif
ifneq (,$(wildcard src/osd/$(OSD)/$(OSD).mak))
include src/osd/$(OSD)/$(OSD).mak
endif
@ -855,13 +816,9 @@ $(GEN_FOLDERS):
generate: \
$(GENIE) \
$(GEN_FOLDERS) \
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS)) \
$(patsubst $(SRC)/%.h,$(GENDIR)/%.moc.c,$(MOC_FILES))
$(patsubst $(SRC)/%.lay,$(GENDIR)/%.lh,$(LAYOUTS))
$(GENDIR)/%.lh: $(SRC)/%.lay $(SRC)/build/file2str.py
@echo Converting $<...
$(PYTHON) $(SRC)/build/file2str.py $< $@ layout_$(basename $(notdir $<))
$(GENDIR)/%.moc.c: $(SRC)/%.h
$(SILENT) $(MOC) $(MOCINCPATH) $< -o $@

View File

@ -99,6 +99,37 @@ function osdmodulesbuild()
defines {
"USE_QTDEBUG=1",
}
local MOC = ""
if (os.is("windows")) then
print("windows")
MOC = "moc"
else
MOCTST = backtick("which moc-qt4 2>/dev/null")
if (MOCTST=='') then
MOCTST = backtick("which moc 2>/dev/null")
end
if (MOCTST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1)
end
MOC = MOCTST
end
custombuildtask {
{ MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.h", GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.h", GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.h", GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.h", GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.c", { }, { MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
{ MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.c", { },{ MOC .. "$(MOCINCPATH) $(<) -o $(@)" }},
}
if _OPTIONS["targetos"]=="windows" then
configuration { "mingw*" }
buildoptions {