diff options
Diffstat (limited to 'xmake/scripts/base')
| -rw-r--r-- | xmake/scripts/base/makefile.lua | 4 | ||||
| -rw-r--r-- | xmake/scripts/base/string.lua | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua index 68ff484e1..1624af101 100644 --- a/xmake/scripts/base/makefile.lua +++ b/xmake/scripts/base/makefile.lua @@ -232,8 +232,8 @@ function makefile.build(target) assert(buildir) -- done build - local ok = os.execute(string.format("make -f %s %s", buildir .. "/makefile", target)) - if ok ~= 0 then + local ok = platform.build(buildir .. "/makefile", target) + if not ok then -- error utils.error("build target: %s failed!", target) return false diff --git a/xmake/scripts/base/string.lua b/xmake/scripts/base/string.lua index 87e37635a..793abad00 100644 --- a/xmake/scripts/base/string.lua +++ b/xmake/scripts/base/string.lua @@ -40,5 +40,14 @@ function string.find_last(self, pattern, plain) end end +-- split string with the given pattern +function string.split(self, pattern) + + -- split it + local list = {} + self:gsub("[^" .. pattern .."]+", function(v) table.insert(list, v) end ) + return list +end + -- return module: string return string |
