diff options
| author | ruki <[email protected]> | 2023-10-23 23:01:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-10-23 23:01:28 +0800 |
| commit | ca2b119caae6424449875117966cb36341733862 (patch) | |
| tree | 2464e584d7b3db602a901df1744d82705ca0147c | |
| parent | ecae2ad7455094fc72ae9abfe8e8a226130fe570 (diff) | |
add linkgroups for package
| -rw-r--r-- | xmake/core/tool/builder.lua | 6 | ||||
| -rw-r--r-- | xmake/languages/c++/load.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index f07fc39d6..dfb47d7d1 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -279,7 +279,9 @@ function builder:_add_flags_from_argument(flags, target, args) -- add flags (named) from the language self:_add_flags_from_language(flags, nil, { - target = function (name) return args[name] end, + target = function (name) + return args[name] + end, toolchain = function (name) local plat, arch if target and target.plat then @@ -296,7 +298,7 @@ end function builder:_add_items_from_getter(items, name, opt) local values = opt.getter(name) if values then - table.insert(items, {name = name, values = table.wrap(values), check = opt.check, multival = opt.multival, mapper = opt.mapper}) + table.insert(items, {name = name, values = table.wrap(values), check = opt.check, multival = opt.multival, mapper = opt.mapper, target = opt.target}) end end diff --git a/xmake/languages/c++/load.lua b/xmake/languages/c++/load.lua index b35938783..4e1eae688 100644 --- a/xmake/languages/c++/load.lua +++ b/xmake/languages/c++/load.lua @@ -72,6 +72,7 @@ function _get_apis() , "package.add_includedirs" --@note we need not uses paths for package, see https://github.com/xmake-io/xmake/issues/717 , "package.add_sysincludedirs" , "package.add_frameworkdirs" + , "package.add_linkgroups" -- toolchain.add_xxx , "toolchain.add_links" , "toolchain.add_syslinks" diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 6589b6f13..7d55c4fdc 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -313,7 +313,7 @@ function nf_linkgroup(self, linkgroup, target) table.insert(linkflags, nf_link(self, lib)) end local flags = {} - if not self:is_plat("macosx", "windows", "mingw") then + if target and not self:is_plat("macosx", "windows", "mingw") then local group = target:extraconf("linkgroups", linkgroup, "group") local whole = target:extraconf("linkgroups", linkgroup, "whole") if group and whole then |
