Commits

Jason Perkins committed 67d51d7

Added force includes to MSC tool definition

Comments (0)

Files changed (3)

 * 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
 
 
 -------

src/tools/msc.lua

 --
 
 	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
 
 

tests/tools/test_msc.lua

 		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