diff options
author | Jason Perkins <starkos@industriousone.com> | 2011-08-23 00:35:51 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2011-08-23 00:35:51 +0400 |
commit | e78d5c2a16345b36f92fabccd3efd80742bc21b1 (patch) | |
tree | 89e85063611a6f2cdbc4a47e242fbadd526543cb /src/base | |
parent | 4963e4d3a67a4cee49b192076962a856e6473801 (diff) |
Fixed #3381011: location breaks vpaths
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/api.lua | 4 | ||||
-rw-r--r-- | src/base/bake.lua | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/base/api.lua b/src/base/api.lua index 86cc26b..3746aa2 100644 --- a/src/base/api.lua +++ b/src/base/api.lua @@ -381,7 +381,7 @@ vpaths = { - kind = "keyvalue", + kind = "keypath", scope = "container", }, @@ -622,7 +622,7 @@ return premake.setdirarray(scope, name, value) elseif kind == "filelist" then return premake.setfilearray(scope, name, value) - elseif kind == "keyvalue" then + elseif kind == "keyvalue" or kind == "keypath" then return premake.setkeyvalue(scope, name, value) end end diff --git a/src/base/bake.lua b/src/base/bake.lua index fe511cb..77f6192 100644 --- a/src/base/bake.lua +++ b/src/base/bake.lua @@ -116,14 +116,22 @@ -- local function adjustpaths(location, obj) + function adjustpathlist(list) + for i, p in ipairs(list) do + list[i] = path.getrelative(location, p) + end + end + for name, value in pairs(obj) do local field = premake.fields[name] if field and value and not keeprelative[name] then if field.kind == "path" then obj[name] = path.getrelative(location, value) elseif field.kind == "dirlist" or field.kind == "filelist" then - for i, p in ipairs(value) do - value[i] = path.getrelative(location, p) + adjustpathlist(value) + elseif field.kind == "keypath" then + for k,v in pairs(value) do + adjustpathlist(v) end end end @@ -144,7 +152,7 @@ local function mergefield(kind, dest, src) local tbl = dest or { } - if kind == "keyvalue" then + if kind == "keyvalue" or kind == "keypath" then for key, value in pairs(src) do tbl[key] = mergefield("list", tbl[key], value) end |