Merge pull request #637 from starkos/fix-vs2015-link-symbols

Fix VS'15 <GenerateDebugInformation> to match Update 3
This commit is contained in:
Samuel Surtees 2016-11-25 18:12:30 +10:00 committed by GitHub
commit 1ed7b0c3fe
2 changed files with 49 additions and 7 deletions

View File

@ -391,12 +391,14 @@
if cfg.kind == p.STATICLIB then
return {
m.subSystem,
m.fullProgramDatabaseFile,
m.generateDebugInformation,
m.optimizeReferences,
}
else
return {
m.subSystem,
m.fullProgramDatabaseFile,
m.generateDebugInformation,
m.optimizeReferences,
m.additionalDependencies,
@ -1294,6 +1296,7 @@
end
end
function m.inlineFunctionExpansion(cfg)
if cfg.inlining then
local types = {
@ -1306,6 +1309,7 @@
end
end
function m.forceIncludes(cfg, condition)
if #cfg.forceincludes > 0 then
local includes = vstudio.path(cfg, cfg.forceincludes)
@ -1322,6 +1326,13 @@
end
function m.fullProgramDatabaseFile(cfg)
if _ACTION >= "vs2015" and cfg.symbols == "FastLink" then
m.element("FullProgramDatabaseFile", nil, "true")
end
end
function m.functionLevelLinking(cfg)
if config.isOptimizedBuild(cfg) then
m.element("FunctionLevelLinking", nil, "true")
@ -1332,13 +1343,9 @@
function m.generateDebugInformation(cfg)
local lookup = {}
if _ACTION >= "vs2015" then
lookup[p.ON] = "Debug"
lookup[p.OFF] = "No"
lookup[p.ON] = "true"
lookup[p.OFF] = "false"
lookup["FastLink"] = "DebugFastLink"
if cfg.symbols == "FastLink" then
m.element("FullProgramDatabaseFile", nil, "true")
end
else
lookup[p.ON] = "true"
lookup[p.OFF] = "false"

View File

@ -129,7 +129,8 @@
-- Test the handling of the Symbols flag.
--
function suite.generateDebugInfo_onSymbols()
function suite.generateDebugInfo_onSymbolsOn_on2010()
premake.action.set("vs2010")
symbols "On"
prepare()
test.capture [[
@ -139,6 +140,40 @@
]]
end
function suite.generateDebugInfo_onSymbolsFastLink_on2010()
premake.action.set("vs2010")
symbols "FastLink"
prepare()
test.capture [[
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
]]
end
function suite.generateDebugInfo_onSymbolsOn_on2015()
premake.action.set("vs2015")
symbols "On"
prepare()
test.capture [[
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
]]
end
function suite.generateDebugInfo_onSymbolsFastLink_on2015()
premake.action.set("vs2015")
symbols "FastLink"
prepare()
test.capture [[
<Link>
<SubSystem>Windows</SubSystem>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
]]
end
--
-- Any system libraries specified in links() should be listed as