summaryrefslogtreecommitdiff
path: root/xmake/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-03-27 17:57:41 +0800
committerruki <[email protected]>2017-03-27 17:58:56 +0800
commit71d627e4aa9b5780e63fc6b679c74548844c5feb (patch)
tree46d8e8c874d045ca1f4d492b6edf82f5d716ae54 /xmake/tools/gcc.lua
parent235bb967883ab0686bab731c8e94a4a0bb7677ab (diff)
fix io.read and io.write raw lua api
Diffstat (limited to 'xmake/tools/gcc.lua')
-rw-r--r--xmake/tools/gcc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua
index a3f40b4b0..d4dc2d930 100644
--- a/xmake/tools/gcc.lua
+++ b/xmake/tools/gcc.lua
@@ -340,7 +340,7 @@ function _compile1(sourcefile, objectfile, incdepfile, flags)
-- translate it
local results = {}
- local incdeps = io.read(tmpfile)
+ local incdeps = io.readfile(tmpfile)
for includefile in string.gmatch(incdeps, "%s+([%w/%.%-%+_%$%.]+)") do
-- save it if belong to the project
@@ -385,7 +385,7 @@ function check(flags)
local sourcefile = os.tmpfile() .. ".c" .. ifelse(_g.kind == "cxx", "pp", "")
-- make stub code
- io.write(sourcefile, "int main(int argc, char** argv)\n{return 0;}")
+ io.writefile(sourcefile, "int main(int argc, char** argv)\n{return 0;}")
-- check it
os.run("%s -c %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)