Merge branch 'master' into luasocket

This commit is contained in:
Tom van Dijck 2018-04-07 14:33:13 +02:00 committed by GitHub
commit d7950bcac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 102 additions and 11 deletions

View File

@ -1199,3 +1199,42 @@
</ClCompile>
]]
end
--
-- Check StaticLib SymbolsPath
--
function suite.generateProgramDataBaseFileName_onStaticLib()
kind "StaticLib"
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
]]
end
function suite.generateNotProgramDataBaseFileName_onSharedLib()
kind "SharedLib"
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
</ClCompile>
]]
end

View File

@ -226,7 +226,37 @@
-- Test the handling of the SymbolsPath flag.
--
function suite.generateDebugInfo_onSymbolsOn_on2010()
function suite.generateProgramDataBaseFile_onStaticLib()
kind "StaticLib"
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
prepare()
test.capture [[
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
]]
end
function suite.generateProgramDataBaseFile_onSharedLib()
kind "SharedLib"
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
prepare()
test.capture [[
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>bin\Debug\MyProject.lib</ImportLibrary>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
</Link>
]]
end
function suite.generateProgramDatabaseFile_onSymbolsOn_on2010()
p.action.set("vs2010")
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -241,7 +271,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsFastLink_on2010()
function suite.generateProgramDatabaseFile_onSymbolsFastLink_on2010()
p.action.set("vs2010")
symbols "Off"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -255,7 +285,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsFull_on2010()
function suite.generateProgramDatabaseFile_onSymbolsFull_on2010()
p.action.set("vs2010")
symbols "Full"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -270,7 +300,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsOn_on2015()
function suite.generateProgramDatabaseFile_onSymbolsOn_on2015()
p.action.set("vs2015")
symbols "On"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -285,7 +315,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsFastLink_on2015()
function suite.generateProgramDatabaseFile_onSymbolsFastLink_on2015()
p.action.set("vs2015")
symbols "FastLink"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -301,7 +331,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsFull_on2015()
function suite.generateProgramDatabaseFile_onSymbolsFull_on2015()
p.action.set("vs2015")
symbols "Full"
symbolspath "$(IntDir)$(TargetName).pdb"
@ -316,7 +346,7 @@
]]
end
function suite.generateDebugInfo_onSymbolsFull_on2017()
function suite.generateProgramDatabaseFile_onSymbolsFull_on2017()
p.action.set("vs2017")
symbols "Full"
symbolspath "$(IntDir)$(TargetName).pdb"

View File

@ -313,7 +313,7 @@
--
m.elements.clCompile = function(cfg)
return {
local calls = {
m.precompiledHeader,
m.warningLevel,
m.treatWarningAsError,
@ -348,6 +348,12 @@
m.callingConvention,
m.languageStandard,
}
if cfg.kind == p.STATICLIB then
table.insert(calls, m.programDatabaseFileName)
end
return calls
end
function m.clCompile(cfg)
@ -2175,13 +2181,29 @@
end
end
function m.programDatabaseFile(cfg)
local function getSymbolsPathRelative(cfg)
if cfg.symbolspath and cfg.symbols ~= p.OFF and cfg.debugformat ~= "c7" then
m.element("ProgramDatabaseFile", nil, p.project.getrelative(cfg.project, cfg.symbolspath))
return p.project.getrelative(cfg.project, cfg.symbolspath)
else
return nil
end
end
function m.programDatabaseFile(cfg)
local value = getSymbolsPathRelative(cfg)
if value then
m.element("ProgramDatabaseFile", nil, value)
end
end
function m.programDatabaseFileName(cfg)
local value = getSymbolsPathRelative(cfg)
if value then
m.element("ProgramDataBaseFileName", nil, value)
end
end
function m.projectGuid(prj)
m.element("ProjectGuid", nil, "{%s}", prj.uuid)