diff options
author | 2017-03-29 17:31:27 +0200 | |
---|---|---|
committer | 2017-03-29 17:31:27 +0200 | |
commit | 88ca8d5b48ab22e85991f2a5f075cad7673caf7d (patch) | |
tree | c3064a9c0a5d4029b930c77606536e888815a8ef /3rdparty/genie/src/_premake_main.lua | |
parent | e095ef959be497299ef77db0c1929579e9c754e1 (diff) |
Update GENie (nw)
Diffstat (limited to '3rdparty/genie/src/_premake_main.lua')
-rw-r--r-- | 3rdparty/genie/src/_premake_main.lua | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/3rdparty/genie/src/_premake_main.lua b/3rdparty/genie/src/_premake_main.lua index 83cf3c00402..b92e4fa6873 100644 --- a/3rdparty/genie/src/_premake_main.lua +++ b/3rdparty/genie/src/_premake_main.lua @@ -49,7 +49,6 @@ -- if running off the disk (in debug mode), load everything -- listed in _manifest.lua; the list divisions make sure -- everything gets initialized in the proper order. - if (scriptpath) then local scripts = dofile(scriptpath .. "/_manifest.lua") for _,v in ipairs(scripts) do @@ -57,28 +56,24 @@ end end + local profiler = newProfiler() + if (nil ~= _OPTIONS["debug-profiler"]) then + profiler:start() + end -- Now that the scripts are loaded, I can use path.getabsolute() to properly -- canonicalize the executable path. - _PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND) - -- Set up the environment for the chosen action early, so side-effects -- can be picked up by the scripts. - premake.action.set(_ACTION) - -- Seed the random number generator so actions don't have to do it themselves - math.randomseed(os.time()) - -- If there is a project script available, run it to get the -- project information, available options and actions, etc. - - if (nil ~= _OPTIONS["file"]) then local fname = _OPTIONS["file"] if (os.isfile(fname)) then @@ -95,7 +90,6 @@ end -- Process special options - if (_OPTIONS["version"] or _OPTIONS["help"] or not _ACTION) then printf("GENie - Project generator tool %s", _GENIE_VERSION_STR) printf("https://github.com/bkaradzic/GENie") @@ -107,7 +101,6 @@ -- Validate the command-line arguments. This has to happen after the -- script has run to allow for project-specific options - action = premake.action.current() if (not action) then error("Error: no such action '" .. _ACTION .. "'", 0) @@ -116,38 +109,18 @@ ok, err = premake.option.validate(_OPTIONS) if (not ok) then error("Error: " .. err, 0) end - -- Sanity check the current project setup - ok, err = premake.checktools() if (not ok) then error("Error: " .. err, 0) end - -- If a platform was specified on the command line, inject it now - ok, err = injectplatform(_OPTIONS["platform"]) if (not ok) then error("Error: " .. err, 0) end - local profiler = newProfiler() - if (nil ~= _OPTIONS["debug-profiler"]) then - profiler:start() - end - -- work-in-progress: build the configurations print("Building configurations...") premake.bake.buildconfigs() - if (nil ~= _OPTIONS["debug-profiler"]) then - profiler:stop() - - local filePath = path.getabsolute("GENie-profiler-bake.txt") - print("Writing debug-profiler report " .. filePath .. ".") - - local outfile = io.open(filePath, "w+") - profiler:report(outfile) - outfile:close() - end - ok, err = premake.checkprojects() if (not ok) then error("Error: " .. err, 0) end @@ -160,6 +133,17 @@ printf("Running action '%s'...", action.trigger) premake.action.call(action.trigger) + if (nil ~= _OPTIONS["debug-profiler"]) then + profiler:stop() + + local filePath = path.getabsolute("GENie-profile.txt") + print("Writing debug-profile report to ''" .. filePath .. "'.") + + local outfile = io.open(filePath, "w+") + profiler:report(outfile, true) + outfile:close() + end + printf("Done. Generated %d/%d projects." , premake.stats.num_generated , premake.stats.num_generated+premake.stats.num_skipped |