summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/linker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-12-25 11:20:45 +0800
committerruki <[email protected]>2015-12-25 11:20:45 +0800
commit3ab31ee7ce09cfb58a3058fb7653991618b2e895 (patch)
tree3a30d33d9047fc31478e1e675782c1cc18d447f0 /xmake/scripts/base/linker.lua
parent757741ef501c2160d08b33dbdfa50ed59a6b7b6a (diff)
fix compile error for share library
Diffstat (limited to 'xmake/scripts/base/linker.lua')
-rw-r--r--xmake/scripts/base/linker.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/scripts/base/linker.lua b/xmake/scripts/base/linker.lua
index 0c4fdb54f..9a0388757 100644
--- a/xmake/scripts/base/linker.lua
+++ b/xmake/scripts/base/linker.lua
@@ -337,6 +337,9 @@ function linker.make(module, target, srcfiles, objfiles, targetfile, logfile)
-- add flags from the linker
linker._addflags_from_linker(module, flags, flagname)
+ -- remove repeat
+ flags = utils.unique(flags)
+
-- make the link command
return module:command_link(table.concat(objfiles, " "), targetfile, table.concat(flags, " "):trim(), logfile)
end
@@ -372,6 +375,9 @@ function linker.check_links(opt, links, sourcefile, objectfile, targetfile)
-- add flags from the linker
linker._addflags_from_linker(module, flags, "ldflags")
+ -- remove repeat
+ flags = utils.unique(flags)
+
-- execute the link command
return module:main(module:command_link(objectfile, targetfile, table.concat(flags, " "):trim(), utils.ifelse(xmake._OPTIONS.verbose, nil, xmake._NULDEV)))
end