diff options
| author | SineStriker <[email protected]> | 2025-04-20 05:07:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-23 11:30:30 +0800 |
| commit | d57cceb19f58b99d5198cea0c32ec306ea22a9fb (patch) | |
| tree | 74f5b5cd3f707887b35fea49e6621dd1ee5b34d7 /xmake/core/project/target.lua | |
| parent | cef17b4c566a186ba8e9dd3dc52ab44901fed9f1 (diff) | |
Add `set_implibdir` to target APIs
Diffstat (limited to 'xmake/core/project/target.lua')
| -rw-r--r-- | xmake/core/project/target.lua | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 411822fcb..ea250b9c9 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1611,20 +1611,22 @@ function _instance:implibdir() return nil end - local targetdir = self:extraconf("targetdir") or {} - local implibdir = nil - for _, v in pairs(targetdir) do - if type(v) == "table" then - implibdir = v["implibdir"] - end - break - end + local implibdir = self:get("implibdir") if not implibdir then - return self:targetdir() + implibdir = self:targetdir() end return implibdir end +-- get the imp-lib file (only on windows) +function _instance:implibfile() + local implibdir = self:implibdir() + if not implibdir then + return nil + end + return path.join(implibdir, path.basename(self:targetfile()) .. (self:is_plat("mingw") and ".dll.a" or ".lib")) +end + -- get the target file name function _instance:filename() @@ -2916,6 +2918,7 @@ function target.apis() -- target.set_xxx "target.set_targetdir" , "target.set_objectdir" + , "target.set_implibdir" , "target.set_dependir" , "target.set_autogendir" , "target.set_configdir" |
