summaryrefslogtreecommitdiff
path: root/xmake/actions
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/actions')
-rwxr-xr-xxmake/actions/build/builder.lua26
1 files changed, 17 insertions, 9 deletions
diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua
index e9880eead..9027b5737 100755
--- a/xmake/actions/build/builder.lua
+++ b/xmake/actions/build/builder.lua
@@ -32,14 +32,22 @@ import("core.project.cache")
import("core.platform.environment")
-- build the object for the *.[o|obj] source file
-function _build_object_for_object(target, srcfile, objfile)
+function _build_object_for_object(target, sourcefile, objectfile, percent)
- -- TODO
- raise("not implemented")
+ -- trace
+ print("[%02d%%]: inserting.$(mode) %s", percent, sourcefile)
+
+ -- trace verbose info
+ if option.get("verbose") then
+ print("cp %s %s", sourcefile, objectfile)
+ end
+
+ -- insert this object file
+ os.cp(sourcefile, objectfile)
end
-- build the object for the *.[a|lib] source file
-function _build_object_for_static(target, srcfile, objfile)
+function _build_object_for_static(target, sourcefile, objectfile, percent)
raise("not implemented")
-- TODO
@@ -64,12 +72,15 @@ function _build_object(target, index)
-- get the source file type
local filetype = path.extension(sourcefile):lower()
+ -- calculate percent
+ local percent = ((_g.targetindex + (index - 1) / #objectfiles) * 100 / _g.targetcount)
+
-- build the object for the *.o/obj source makefile
if filetype == ".o" or filetype == ".obj" then
- return _build_object_for_object(target, sourcefile, objectfile)
+ return _build_object_for_object(target, sourcefile, objectfile, percent)
-- build the object for the *.[a|lib] source file
elseif filetype == ".a" or filetype == ".lib" then
- return _build_object_for_static(target, sourcefile, objectfile)
+ return _build_object_for_static(target, sourcefile, objectfile, percent)
end
-- make command
@@ -79,9 +90,6 @@ function _build_object(target, index)
command = ccache:append(command, " ")
end
- -- calculate percent
- local percent = ((_g.targetindex + (index - 1) / #objectfiles) * 100 / _g.targetcount)
-
-- trace
print("[%02d%%]: %scompiling.$(mode) %s", percent, ifelse(ccache, "ccache ", ""), sourcefile)