Add syslibdirs and VC 2010+ implementation

This commit is contained in:
Jason Perkins 2015-05-17 17:53:55 -04:00
parent ee1f165c8a
commit 7eb03dfa27
3 changed files with 31 additions and 0 deletions

View File

@ -828,6 +828,13 @@
tokens = true,
}
api.register {
name = "syslibdirs",
scope = "config",
kind = "list:directory",
tokens = true,
}
api.register {
name = "system",
scope = "config",

View File

@ -195,6 +195,7 @@
m.targetName,
m.targetExt,
m.includePath,
m.libraryPath,
m.imageXexOutput,
m.generateManifest,
m.extensionsToDeleteOnClean,
@ -1296,6 +1297,14 @@
end
function m.libraryPath(cfg)
local dirs = vstudio.path(cfg, cfg.syslibdirs)
if #dirs > 0 then
p.x('<LibraryPath>%s;$(LibraryPath)</LibraryPath>', table.concat(dirs, ";"))
end
end
function m.linkIncremental(cfg)
if cfg.kind ~= premake.STATICLIB then

View File

@ -273,3 +273,18 @@
</PropertyGroup>
]]
end
function suite.onSystemLibraryDirs()
syslibdirs { "$(DXSDK_DIR)/lib/x86" }
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\</OutDir>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>.exe</TargetExt>
<LibraryPath>$(DXSDK_DIR)\lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
]]
end