Add force includes for SNC; allow configuration context proxy to be reset by exporter code

This commit is contained in:
Jason Perkins 2012-11-07 09:46:47 -05:00
parent 89deec0474
commit 80a60231db
3 changed files with 15 additions and 11 deletions

View File

@ -208,6 +208,9 @@
return premake5.project.getrelative(cfg.project, cfg[key])
end
return cfg[key]
end,
__newindex = function(proxy, key, value)
cfg[key] = value
end
})

View File

@ -14,17 +14,7 @@
-- SNC flags for specific systems and architectures.
--
snc.sysflags = {
}
--
-- Retrieve the CPPFLAGS for a specific configuration.
--
function snc.getcppflags(cfg)
return { "-MMD", "-MP" }
end
snc.sysflags = {}
--
@ -85,6 +75,7 @@
-- These are the same as GCC
--
snc.getcppflags = gcc.getcppflags
snc.getdefines = gcc.getdefines
snc.getincludedirs = gcc.getincludedirs
snc.getlinks = gcc.getlinks

View File

@ -129,3 +129,13 @@
test.isequal({ "generated.o" }, snc.getlinks(cfg))
end
--
-- Check handling of forced includes.
--
function suite.forcedIncludeFiles()
forceincludes { "stdafx.h", "include/sys.h" }
prepare()
test.isequal({"-MMD", "-MP", '-include "stdafx.h"', '-include "include/sys.h"'}, snc.getcppflags(cfg))
end