diff options
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/build/link_objects.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/target/action/clean/main.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/target/action/install/main.lua | 4 |
3 files changed, 11 insertions, 12 deletions
diff --git a/xmake/modules/private/action/build/link_objects.lua b/xmake/modules/private/action/build/link_objects.lua index 0ff51e17d..d10ae1ef4 100644 --- a/xmake/modules/private/action/build/link_objects.lua +++ b/xmake/modules/private/action/build/link_objects.lua @@ -47,18 +47,13 @@ function _do_link_target(target, opt) local objectfiles = target:objectfiles() local verbose = option.get("verbose") - local target_implib = nil - if target:has_implib() then - target_implib = target:artifactfile("lib") - end - if verbose then -- show the full link command with raw arguments, it will expand @xxx.args for msvc/link on windows - print(linkinst:linkcmd(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib, rawargs = true})) + print(linkinst:linkcmd(objectfiles, targetfile, {linkflags = linkflags, implib = target:byproduct("implib"), rawargs = true})) end if not dryrun then - assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib})) + assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target:byproduct("implib")})) end end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), diff --git a/xmake/modules/target/action/clean/main.lua b/xmake/modules/target/action/clean/main.lua index b919c4d63..8d828248d 100644 --- a/xmake/modules/target/action/clean/main.lua +++ b/xmake/modules/target/action/clean/main.lua @@ -39,14 +39,18 @@ function main(target) -- @see https://github.com/xmake-io/xmake/issues/3052 if target:is_shared() then if target:is_plat("windows") then - local expfile = path.join(target:artifactdir("lib"), path.basename(targetfile) .. ".exp") + local libfile = target:byproduct("implib") + local expfile = path.join(path.directory(libfile), path.basename(targetfile) .. ".exp") + if os.isfile(libfile) then + remove_files(libfile) + end if os.isfile(expfile) then remove_files(expfile) end end - if target:has_implib() then - local libfile = target:artifactfile("lib") + if target:is_plat("mingw") then + local libfile = target:byproduct("implib") if os.isfile(libfile) then remove_files(libfile) end diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua index 321591ea2..fa598b20c 100644 --- a/xmake/modules/target/action/install/main.lua +++ b/xmake/modules/target/action/install/main.lua @@ -232,12 +232,12 @@ function _install_shared(target, opt) os.mkdir(bindir) local targetfile = target:targetfile() - if target:has_implib() then + if target:is_plat("windows", "mingw") then -- install *.lib for shared/windows (*.dll) target -- @see https://github.com/xmake-io/xmake/issues/714 os.vcp(target:targetfile(), bindir) local libdir = _get_target_libdir(target, opt) - local target_implib = target:artifact("lib") + local target_implib = target:byproduct("implib") if os.isfile(target_implib) then os.mkdir(libdir) os.vcp(target_implib, libdir) |
