summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-04-09 14:18:42 +0800
committerruki <[email protected]>2017-04-09 14:18:42 +0800
commit23ffe01a0b47f0d9e827c3cb6e0c57749a9ac0de (patch)
tree70dd683530a456de69b2a291c217f7d429f9826a
parent75ce1622c65240df4017b79d123f64cb6ae8d4c8 (diff)
support not kind
-rw-r--r--xmake/actions/build/builder.lua6
-rw-r--r--xmake/actions/clean/main.lua5
-rw-r--r--xmake/actions/package/main.lua3
-rw-r--r--xmake/actions/run/main.lua3
-rw-r--r--xmake/platforms/installer.lua20
5 files changed, 35 insertions, 2 deletions
diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua
index beef67c41..a910e6107 100644
--- a/xmake/actions/build/builder.lua
+++ b/xmake/actions/build/builder.lua
@@ -31,8 +31,10 @@ import("core.platform.environment")
function _on_build_target(target)
-- the target kind
- local kind = target:get("kind")
- assert(kind, "target(%s).kind not found!", target:name())
+ local kind = target:targetkind()
+ if not kind then
+ return
+ end
-- build target
import("kinds." .. kind).build(target, _g)
diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua
index eb5f85cab..37e7d0788 100644
--- a/xmake/actions/clean/main.lua
+++ b/xmake/actions/clean/main.lua
@@ -51,6 +51,11 @@ end
-- on clean target
function _on_clean_target(target)
+ -- no target kind?
+ if not target:targetkind() then
+ return
+ end
+
-- remove the target file
_remove(target:targetfile())
diff --git a/xmake/actions/package/main.lua b/xmake/actions/package/main.lua
index 0e0566c92..25328a25c 100644
--- a/xmake/actions/package/main.lua
+++ b/xmake/actions/package/main.lua
@@ -117,6 +117,9 @@ function _package_target(target)
-- get kind
local kind = target:get("kind")
+ if not kind then
+ return
+ end
-- get script
local scripts =
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua
index 3082783fe..b2b13ae96 100644
--- a/xmake/actions/run/main.lua
+++ b/xmake/actions/run/main.lua
@@ -51,6 +51,9 @@ function _run_target(target)
-- get kind
local kind = target:get("kind")
+ if not kind then
+ return
+ end
-- get script
local scripts =
diff --git a/xmake/platforms/installer.lua b/xmake/platforms/installer.lua
index 0cc388edb..12aa9132c 100644
--- a/xmake/platforms/installer.lua
+++ b/xmake/platforms/installer.lua
@@ -29,6 +29,11 @@ import("core.platform.platform")
-- install binary
function install_binary_on_unix(target)
+ -- check kind
+ if not target:targetkind() then
+ return
+ end
+
-- the install directory
local installdir = option.get("installdir") or platform.get("installdir")
assert(installdir, "unknown install directory!")
@@ -46,6 +51,11 @@ end
-- install library
function install_library_on_unix(target)
+ -- check kind
+ if not target:targetkind() then
+ return
+ end
+
-- the install directory
local installdir = option.get("installdir") or platform.get("installdir")
assert(installdir, "unknown install directory!")
@@ -88,6 +98,11 @@ end
-- uninstall binary
function uninstall_binary_on_unix(target)
+ -- check kind
+ if not target:targetkind() then
+ return
+ end
+
-- the install directory
local installdir = option.get("installdir") or platform.get("installdir")
assert(installdir, "unknown install directory!")
@@ -102,6 +117,11 @@ end
-- uninstall library
function uninstall_library_on_unix(target)
+ -- check kind
+ if not target:targetkind() then
+ return
+ end
+
-- the install directory
local installdir = option.get("installdir") or platform.get("installdir")
assert(installdir, "unknown install directory!")