summaryrefslogtreecommitdiff
path: root/xmake/actions
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-09 15:08:28 +0800
committerruki <[email protected]>2016-07-09 15:08:28 +0800
commit9feb387e4e4e6694b2c9ac3de4d517fb4c4ae44a (patch)
tree9581332e5365025b5663c3c48f223a9dfd6f415c /xmake/actions
parent460030d64886772601749b874f06fe536f1d3fd5 (diff)
fix install directory and modify compiler and linker interfaces
Diffstat (limited to 'xmake/actions')
-rwxr-xr-xxmake/actions/build/builder.lua35
-rwxr-xr-xxmake/actions/install/xmake.lua4
-rwxr-xr-xxmake/actions/uninstall/xmake.lua5
3 files changed, 21 insertions, 23 deletions
diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua
index 8264e4476..b10e76bbe 100755
--- a/xmake/actions/build/builder.lua
+++ b/xmake/actions/build/builder.lua
@@ -91,31 +91,30 @@ function _build_object(target, index)
return _build_object_for_static(target, sourcefile, objectfile, percent)
end
- -- make command
- local command = compiler.compcmd(sourcefile, objectfile, target)
-
-- uses ccache
local ccache = nil
if config.get("ccache") then
ccache = tool.shellname("ccache")
end
- if ccache then
- command = ccache:append(command, " ")
- end
-- trace
print("[%02d%%]: %scompiling.$(mode) %s", percent, ifelse(ccache, "ccache ", ""), sourcefile)
-- trace verbose info
if option.get("verbose") then
+
+ -- make command
+ local command = compiler.compcmd(sourcefile, objectfile, target)
+ if ccache then
+ command = ccache:append(command, " ")
+ end
+
+ -- trace
print(command)
end
- -- create directory if not exists
- os.mkdir(path.directory(objectfile))
-
- -- run cmd with coroutine
- os.corun(command)
+ -- complie it and enable multitasking
+ compiler.compile(sourcefile, objectfile, target, true)
end
-- make objects for the given target
@@ -205,23 +204,19 @@ function _build_target(target)
end
end
- -- make the command for linking target
- local targetfile = target:targetfile()
- local command = linker.linkcmd(objectfiles, targetfile, target)
+ -- the target file
+ local targetfile = target:targetfile()
-- trace
print("[%02d%%]: linking.$(mode) %s", _g.targetindex * 100 / _g.targetcount, path.filename(targetfile))
-- trace verbose info
if option.get("verbose") then
- print(command)
+ print(linker.linkcmd(objectfiles, targetfile, target))
end
- -- create directory if not exists
- os.mkdir(path.directory(targetfile))
-
- -- run command
- os.run(command)
+ -- link it
+ linker.link(objectfiles, targetfile, target)
end
-- make the given target
diff --git a/xmake/actions/install/xmake.lua b/xmake/actions/install/xmake.lua
index d2160490e..11fdd1270 100755
--- a/xmake/actions/install/xmake.lua
+++ b/xmake/actions/install/xmake.lua
@@ -43,10 +43,10 @@ task("install")
-- options
, options =
{
- {'o', "installdir", "kv", nil, "Set the install directory." }
+ {'o', "installdir", "kv", nil, "Set the install directory." }
, {}
- , {nil, "target", "v", "all", "Install the given target." }
+ , {nil, "target", "v", "all", "Install the given target." }
}
})
diff --git a/xmake/actions/uninstall/xmake.lua b/xmake/actions/uninstall/xmake.lua
index b4ef7e8d4..881dc8274 100755
--- a/xmake/actions/uninstall/xmake.lua
+++ b/xmake/actions/uninstall/xmake.lua
@@ -43,7 +43,10 @@ task("uninstall")
-- options
, options =
{
- {nil, "target", "v", "all", "Install the given target." }
+ {nil, "installdir", "kv", nil, "Set the install directory." }
+
+ , {}
+ , {nil, "target", "v", "all", "Uninstall the given target." }
}
})