summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA2va <[email protected]>2024-09-20 19:47:00 +0200
committerA2va <[email protected]>2024-09-20 19:47:00 +0200
commitf92bdc11978e585ae349432e3c519861b803f604 (patch)
tree1e0a9a0933efa4d83a4e7c02cf5f94d17efbdb9a
parent60df5b236a5ea26a1c0acab29a9b627e1cef12ad (diff)
Remove true_bindir argument
-rw-r--r--xmake/modules/target/action/install/main.lua16
-rw-r--r--xmake/modules/target/action/uninstall/main.lua14
2 files changed, 11 insertions, 19 deletions
diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua
index 0e1c9eda3..9b70a9096 100644
--- a/xmake/modules/target/action/install/main.lua
+++ b/xmake/modules/target/action/install/main.lua
@@ -35,14 +35,10 @@ end
function _get_target_bindir(target, opt)
if not opt.installdir then
- return (target:is_plat("windows", "mingw") or opt.true_bindir) and target:bindir() or target:libdir()
+ return target:bindir()
end
- assert(opt.libdir, "opt.libdir is missing")
assert(opt.bindir, "opt.bindir is missing")
-
- local bindir = path.join(opt.installdir, opt.bindir)
- local libdir = path.join(opt.installdir, opt.libdir)
- return (target:is_plat("windows", "mingw") or opt.true_bindir) and bindir or libdir
+ return path.join(opt.installdir, opt.bindir)
end
-- we need to get all deplibs, e.g. app -> libfoo.so -> libbar.so ...
@@ -143,7 +139,7 @@ end
-- install shared libraries
function _install_shared_libraries(target, opt)
- local bindir = _get_target_bindir(target, opt)
+ local bindir = target:is_plat("windows", "mingw") and _get_target_bindir(target, opt) or _get_target_libdir(target, opt)
-- get all dependent shared libraries
local libfiles = {}
@@ -178,7 +174,7 @@ function _update_install_rpath(target, opt)
if target:is_plat("windows", "mingw") then
return
end
- local bindir = _get_target_bindir(target, table.join(opt, {true_bindir = true}))
+ local bindir = _get_target_bindir(target, opt)
local targetfile = path.join(bindir, target:filename())
if target:policy("install.rpath") then
local result, sources = target:get_from("rpathdirs", "*")
@@ -199,7 +195,7 @@ end
-- install binary
function _install_binary(target, opt)
- local bindir = _get_target_bindir(target, table.join(opt, {true_bindir = true}))
+ local bindir = _get_target_bindir(target, opt)
os.mkdir(bindir)
os.vcp(target:targetfile(), bindir)
os.trycp(target:symbolfile(), path.join(bindir, path.filename(target:symbolfile())))
@@ -209,7 +205,7 @@ end
-- install shared library
function _install_shared(target, opt)
- local bindir = _get_target_bindir(target, opt)
+ local bindir = target:is_plat("windows", "mingw") and _get_target_bindir(target, opt) or _get_target_libdir(target, opt)
os.mkdir(bindir)
local targetfile = target:targetfile()
diff --git a/xmake/modules/target/action/uninstall/main.lua b/xmake/modules/target/action/uninstall/main.lua
index 81b4103b2..e36d5617a 100644
--- a/xmake/modules/target/action/uninstall/main.lua
+++ b/xmake/modules/target/action/uninstall/main.lua
@@ -35,14 +35,10 @@ end
function _get_target_bindir(target, opt)
if not opt.installdir then
- return (target:is_plat("windows", "mingw") or opt.true_bindir) and target:bindir() or target:libdir()
+ return target:bindir()
end
- assert(opt.libdir, "opt.libdir is missing")
assert(opt.bindir, "opt.bindir is missing")
-
- local bindir = path.join(opt.installdir, opt.bindir)
- local libdir = path.join(opt.installdir, opt.libdir)
- return (target:is_plat("windows", "mingw") or opt.true_bindir) and bindir or libdir
+ return path.join(opt.installdir, opt.bindir)
end
-- we need to get all deplibs, e.g. app -> libfoo.so -> libbar.so ...
@@ -133,7 +129,7 @@ end
-- uninstall shared libraries
function _uninstall_shared_libraries(target, opt)
- local bindir = _get_target_bindir(target, opt)
+ local bindir = target:is_plat("windows", "mingw") and _get_target_bindir(target, opt) or _get_target_libdir(target, opt)
-- get all dependent shared libraries
local libfiles = {}
for _, dep in ipairs(target:orderdeps()) do
@@ -160,7 +156,7 @@ end
-- uninstall binary
function _uninstall_binary(target, opt)
- local bindir = _get_target_bindir(target, table.join(opt, {true_bindir = true}))
+ local bindir = _get_target_bindir(target, opt)
remove_files(path.join(bindir, path.filename(target:targetfile())), {emptydir = true})
remove_files(path.join(bindir, path.filename(target:symbolfile())), {emptydir = true})
_uninstall_shared_libraries(target, opt)
@@ -168,7 +164,7 @@ end
-- uninstall shared library
function _uninstall_shared(target, opt)
- local bindir = _get_target_bindir(target, opt)
+ local bindir = target:is_plat("windows", "mingw") and _get_target_bindir(target, opt) or _get_target_libdir(target, opt)
if target:is_plat("windows", "mingw") then
-- uninstall *.lib for shared/windows (*.dll) target
-- @see https://github.com/xmake-io/xmake/issues/714