From 124f30dbbc30b0153e1070a5db09e577b4af1919 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 8 Dec 2016 11:46:15 +0100 Subject: Enable building projects that are separate of MAME but use same core and lives in separate git tree (nw) --- scripts/genie.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'scripts/genie.lua') diff --git a/scripts/genie.lua b/scripts/genie.lua index 7a4668e7d14..653c8b69e37 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -386,6 +386,11 @@ newoption { description = "Produce WebAssembly output when building with Emscripten.", } +newoption { + trigger = "PROJECT", + description = "Select projects to be built. Will look into project folder for files.", +} + dofile ("extlib.lua") if _OPTIONS["SHLIB"]=="1" then @@ -516,7 +521,14 @@ msgprecompile ("Precompiling $(subst ../,,$<)...") messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" } -if (_OPTIONS["SOURCES"] == nil) then +if (_OPTIONS["PROJECT"] ~= nil) then + PROJECT_DIR = path.join(path.getabsolute(".."),"projects",_OPTIONS["PROJECT"]) .. "/" + if (not os.isfile(path.join("..", "projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then + error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") + end + dofile (path.join(".." ,"projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) +end +if (_OPTIONS["SOURCES"] == nil and _OPTIONS["PROJECT"] == nil) then if (not os.isfile(path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") end -- cgit v1.2.3-70-g09d2