summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-06 00:46:56 +0800
committerruki <[email protected]>2021-10-05 22:43:17 +0800
commit2c8c745ba9caa35734a3b21fc91c694273a000bd (patch)
tree87b4d8361c493b76ea4e11a79773c67568f7eade
parent234de16d4ab8358ceac69bc1ff042130b707a3fb (diff)
improve install and uninstall
-rw-r--r--xmake/modules/target/action/install/main.lua11
-rw-r--r--xmake/modules/target/action/install/unix.lua5
-rw-r--r--xmake/modules/target/action/install/windows.lua5
-rw-r--r--xmake/modules/target/action/uninstall/unix.lua5
-rw-r--r--xmake/modules/target/action/uninstall/windows.lua5
5 files changed, 24 insertions, 7 deletions
diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua
index 289d258f0..c115e836e 100644
--- a/xmake/modules/target/action/install/main.lua
+++ b/xmake/modules/target/action/install/main.lua
@@ -20,7 +20,6 @@
-- install files
function _install_files(target)
-
local srcfiles, dstfiles = target:installfiles()
if srcfiles and dstfiles then
local i = 1
@@ -47,12 +46,10 @@ function main(target, opt)
print("installing %s to %s ..", target:name(), installdir)
-- call script
- if not target:is_phony() then
- local install_style = target:is_plat("windows", "mingw") and "windows" or "unix"
- local script = import(install_style, {anonymous = true})["install_" .. target:kind()]
- if script then
- script(target, opt)
- end
+ local install_style = target:is_plat("windows", "mingw") and "windows" or "unix"
+ local script = import(install_style, {anonymous = true})["install_" .. target:kind()]
+ if script then
+ script(target, opt)
end
-- install other files
diff --git a/xmake/modules/target/action/install/unix.lua b/xmake/modules/target/action/install/unix.lua
index 521ed40de..165d8650e 100644
--- a/xmake/modules/target/action/install/unix.lua
+++ b/xmake/modules/target/action/install/unix.lua
@@ -126,3 +126,8 @@ function install_static(target, opt)
-- install headers
_install_headers(target, opt)
end
+
+-- install phony
+function install_phony(target, opt)
+ _install_headers(target, opt)
+end
diff --git a/xmake/modules/target/action/install/windows.lua b/xmake/modules/target/action/install/windows.lua
index 87a7413ca..448415fa6 100644
--- a/xmake/modules/target/action/install/windows.lua
+++ b/xmake/modules/target/action/install/windows.lua
@@ -134,3 +134,8 @@ function install_static(target, opt)
-- install headers
_install_headers(target, opt)
end
+
+-- install phony
+function install_phony(target, opt)
+ _install_headers(target, opt)
+end
diff --git a/xmake/modules/target/action/uninstall/unix.lua b/xmake/modules/target/action/uninstall/unix.lua
index e13057fa1..614d59448 100644
--- a/xmake/modules/target/action/uninstall/unix.lua
+++ b/xmake/modules/target/action/uninstall/unix.lua
@@ -95,3 +95,8 @@ function uninstall_static(target, opt)
-- remove headers from the include directory
_uninstall_headers(target, opt)
end
+
+-- uninstall phony
+function uninstall_phony(target, opt)
+ _uninstall_headers(target, opt)
+end
diff --git a/xmake/modules/target/action/uninstall/windows.lua b/xmake/modules/target/action/uninstall/windows.lua
index 2915966db..cb9dcf16e 100644
--- a/xmake/modules/target/action/uninstall/windows.lua
+++ b/xmake/modules/target/action/uninstall/windows.lua
@@ -100,3 +100,8 @@ function uninstall_static(target, opt)
-- remove headers from the include directory
_uninstall_headers(target, opt)
end
+
+-- uninstall phony
+function uninstall_phony(target, opt)
+ _uninstall_headers(target, opt)
+end