Added force includes to MSC tool definition

This commit is contained in:
Jason Perkins 2012-11-09 11:07:01 -05:00
parent 8e8beb4312
commit 400ad0a0be
3 changed files with 20 additions and 1 deletions

View File

@ -20,6 +20,7 @@
* Added NoWarnings flag for Visual Studio (xpol)
* Added debugcommand for Visual Studio (xpol)
* Bug 1674173: Allow source files to have the same name
* Added forceinclude() to specify forced include files
-------

View File

@ -16,7 +16,14 @@
--
function msc.getcppflags(cfg)
return {}
local flags = {}
for _, fi in ipairs(cfg.forceincludes) do
local fn = project.getrelative(cfg.project, fi)
table.insert(flags, string.format('/FI "%s"', fn))
end
return flags
end

View File

@ -48,3 +48,14 @@
prepare()
test.isequal({ '/LIBPATH:"../libs"', '/LIBPATH:"libs"' }, msc.getldflags(cfg))
end
--
-- Check handling of forced includes.
--
function suite.forcedIncludeFiles()
forceincludes { "stdafx.h", "include/sys.h" }
prepare()
test.isequal({'/FI "stdafx.h"', '/FI "include/sys.h"'}, msc.getcppflags(cfg))
end