Added forceusings()

This commit is contained in:
Jason Perkins 2013-02-20 09:57:37 -05:00
parent 453cae7362
commit d5e3272957
5 changed files with 43 additions and 0 deletions

View File

@ -980,6 +980,10 @@
local includes = project.getrelative(cfg.project, cfg.forceincludes)
_x(4,'ForcedIncludeFiles="%s"', table.concat(includes, ';'))
end
if #cfg.forceusings > 0 then
local usings = project.getrelative(cfg.project, cfg.forceusings)
_x(4,'ForcedUsingFiles="%s"', table.concat(usings, ';'))
end
end

View File

@ -619,6 +619,10 @@
local includes = project.getrelative(cfg.project, cfg.forceincludes)
_x(3,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>', table.concat(includes, ';'))
end
if #cfg.forceusings > 0 then
local usings = project.getrelative(cfg.project, cfg.forceusings)
_x(3,'<ForcedUsingFiles>%s</ForcedUsingFiles>', table.concat(usings, ';'))
end
end

View File

@ -672,6 +672,12 @@
kind = "file-list",
}
api.register {
name = "forceusings",
scope = "config",
kind = "file-list",
}
api.register {
name = "framework",
scope = "project",

View File

@ -462,6 +462,24 @@
]]
end
function suite.forcedUsingFiles()
forceusings { "stdafx.h", "include/sys.h" }
prepare()
test.capture [[
<Tool
Name="VCCLCompilerTool"
Optimization="0"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(OutDir)\MyProject.pdb"
WarningLevel="3"
DebugInformationFormat="0"
ForcedUsingFiles="stdafx.h;include/sys.h"
]]
end
--
-- Verify handling of the NoRuntimeChecks flag.

View File

@ -555,6 +555,17 @@
]]
end
function suite.forcedUsingFiles()
forceusings { "stdafx.h", "include/sys.h" }
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<ForcedUsingFiles>stdafx.h;include/sys.h</ForcedUsingFiles>
]]
end
--
-- Check handling of the NoRuntimeChecks flag.