summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/build/link_objects.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/private/action/build/link_objects.lua')
-rw-r--r--xmake/modules/private/action/build/link_objects.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/private/action/build/link_objects.lua b/xmake/modules/private/action/build/link_objects.lua
index 8d3c8e7a1..0ff51e17d 100644
--- a/xmake/modules/private/action/build/link_objects.lua
+++ b/xmake/modules/private/action/build/link_objects.lua
@@ -46,13 +46,19 @@ function _do_link_target(target, opt)
local targetfile = target:targetfile()
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:implibfile(), rawargs = true}))
+ print(linkinst:linkcmd(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib, rawargs = true}))
end
if not dryrun then
- assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target:implibfile()}))
+ assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags, implib = target_implib}))
end
end, {dependfile = target:dependfile(),
lastmtime = os.mtime(target:targetfile()),