summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-02-29 14:46:27 -0800
committerMichael Forney <mforney@mforney.org>2020-03-01 19:24:52 -0800
commitae1a07197ca9ff480773875725e18a434053e6e3 (patch)
tree6b9e4a4e1ce477fd4de4386edff7a580938887f0
parent644b989f2d35f38b6703cf4a486c6280bc413bf0 (diff)
Add support for architecture-dependent sources
-rw-r--r--ninja.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/ninja.lua b/ninja.lua
index 79ff3f1b..f22c1d62 100644
--- a/ninja.lua
+++ b/ninja.lua
@@ -76,6 +76,8 @@ local function pathsgen(s, i)
local first = not i
while true do
i = s:find('%g', i)
+ local _, j, arch = s:find('^@([^%s()]*)%s*%g?', i)
+ if arch then i = j end
if not i or s:sub(i, i) == ')' then
break
end
@@ -110,7 +112,9 @@ local function pathsgen(s, i)
break
end
end
- expandgen(parts)
+ if not arch or arch == config.target.platform:match('[^-]*') then
+ expandgen(parts)
+ end
if not c or c == ')' then
break
end