Merge pull request #1571 from cos-public/usefullpaths-vs-property

useFullPaths config property for Visual Studio projects
This commit is contained in:
Samuel Surtees 2020-12-24 18:45:42 +10:00 committed by GitHub
commit 9b8b035a8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 1 deletions

View File

@ -1510,3 +1510,42 @@
</ClCompile>
]]
end
--
-- If useFullPaths flag is set, add <UseFullPaths> element
--
function suite.onUseFullPathsOff()
usefullpaths "Off"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<UseFullPaths>false</UseFullPaths>
]]
end
function suite.onUseFullPathsOn()
usefullpaths "On"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<UseFullPaths>true</UseFullPaths>
]]
end
function suite.onUseFullPathsNotSpecified()
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
</ClCompile>
]]
end

View File

@ -385,7 +385,8 @@
m.callingConvention,
m.languageStandard,
m.conformanceMode,
m.structMemberAlignment
m.structMemberAlignment,
m.useFullPaths
}
if cfg.kind == p.STATICLIB then
@ -1504,6 +1505,16 @@
end
end
function m.useFullPaths(cfg)
if cfg.useFullPaths ~= nil then
if cfg.useFullPaths then
m.element("UseFullPaths", nil, "true")
else
m.element("UseFullPaths", nil, "false")
end
end
end
function m.additionalCompileOptions(cfg, condition)
local opts = cfg.buildoptions
if _ACTION == "vs2015" or vstudio.isMakefile(cfg) then

View File

@ -789,6 +789,12 @@
kind = "boolean"
}
api.register {
name = "usefullpaths",
scope = "config",
kind = "boolean"
}
api.register {
name = "swiftversion",
scope = "config",