diff options
| author | ruki <[email protected]> | 2017-06-12 22:50:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-12 22:50:31 +0800 |
| commit | fe5c0e9a6b99ae6ad3ab7ab24d50018fe1c8442d (patch) | |
| tree | ae69d92bb776bd3956ec006f9569709f9867c1ce /xmake/core/project/target.lua | |
| parent | b176145e2efa26ca36b166d7e838afcc207050a4 (diff) | |
simplify find_library
Diffstat (limited to 'xmake/core/project/target.lua')
| -rw-r--r-- | xmake/core/project/target.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index bfb986123..008cddc91 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -66,26 +66,28 @@ function target.new(name, info) end -- get the target info -function target:get(infoname) - - -- check - assert(self and self._INFO and infoname) +function target:get(name) + return self._INFO[name] +end - -- get it - return self._INFO[infoname] +-- add the value to the target info +function target:add(name_or_info, ...) + if type(name_or_info) == "string" then + self._INFO[name_or_info] = table.unique(table.join2(table.wrap(self._INFO[name_or_info]), ...)) + elseif type(name_or_info) == "table" and #name_or_info == 0 then + for name, info in pairs(name_or_info) do + self:add(name, info) + end + end end -- get the target name function target:name() - - -- get it return self._NAME end -- get the base name of target file function target:basename() - - -- get it return self:get("basename") end |
