Merge pull request #161 from Blizzard/entrypoint-api

add 'entrypoint' API.
This commit is contained in:
starkos 2015-07-30 18:54:57 -04:00
commit 8ee9529315
2 changed files with 45 additions and 31 deletions

View File

@ -392,6 +392,12 @@
},
}
api.register {
name = "entrypoint",
scope = "config",
kind = "string",
}
api.register {
name = "fatalwarnings",
scope = "config",

View File

@ -536,7 +536,6 @@
end
--
-- Reference any managed assemblies listed in the links()
--
@ -583,17 +582,18 @@
}
end
function m.files(prj)
local groups = m.categorizeSources(prj)
p.callArray(m.elements.files, prj, groups)
end
m.elements.ClCompileFile = function(cfg, file)
return {}
end
m.elements.ClCompileFileCfg = function(fcfg, condition)
if fcfg then
return {
@ -616,26 +616,27 @@
end
end
function m.clCompileFiles(prj, groups)
m.emitFiles(prj, groups, "ClCompile")
end
m.elements.ClIncludeFile = function(cfg, file)
return {}
end
m.elements.ClIncludeFileCfg = function(fcfg, condition)
return {}
end
function m.clIncludeFiles(prj, groups)
m.emitFiles(prj, groups, "ClInclude")
end
m.elements.CustomBuildFile = function(cfg, file)
return {
m.fileType
@ -707,16 +708,17 @@
return {}
end
m.elements.NoneFileCfg = function(fcfg, condition)
return {}
end
function m.noneFiles(prj, groups)
m.emitFiles(prj, groups, "None")
end
m.elements.ResourceCompileFile = function(cfg, file)
return {}
end
@ -727,6 +729,7 @@
}
end
function m.resourceCompileFiles(prj, groups)
m.emitFiles(prj, groups, "ResourceCompile", function(cfg)
return cfg.system == p.WINDOWS
@ -739,6 +742,7 @@
return {}
end
m.elements.MidlFileCfg = function(fcfg, condition)
return {
m.excludedFromBuild
@ -1123,7 +1127,10 @@
function m.entryPointSymbol(cfg)
if (cfg.kind == p.CONSOLEAPP or cfg.kind == p.WINDOWEDAPP) and
if cfg.entrypoint then
m.element("EntryPointSymbol", nil, cfg.entrypoint)
else
if (cfg.kind == premake.CONSOLEAPP or cfg.kind == premake.WINDOWEDAPP) and
not cfg.flags.WinMain and
cfg.clr == p.OFF and
cfg.system ~= p.XBOX360
@ -1131,6 +1138,7 @@
m.element("EntryPointSymbol", nil, "mainCRTStartup")
end
end
end
function m.exceptionHandling(cfg)