diff options
| author | xq114 <[email protected]> | 2021-08-11 22:32:08 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2021-08-11 22:32:08 +0800 |
| commit | 9a29212b893502d685282660ab34646e167be1e9 (patch) | |
| tree | 8c9c25040611f62a9d080ef7787ab9baffdf3d5a | |
| parent | 9c5d90b1f884b600fbc7e9327ba34ad6328fe5c5 (diff) | |
fix libfile on mingw
| -rw-r--r-- | xmake/modules/target/action/install/cmake_importfiles.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/target/action/install/cmake_importfiles.lua b/xmake/modules/target/action/install/cmake_importfiles.lua index 35479d3c1..0b6a8c276 100644 --- a/xmake/modules/target/action/install/cmake_importfiles.lua +++ b/xmake/modules/target/action/install/cmake_importfiles.lua @@ -23,9 +23,15 @@ import("core.project.project") -- get the builtin variables function _get_builtinvars(target, installdir) + local libfile = path.filename(target:targetfile()) + if target:is_plat("windows") then + libfile = libfile:gsub("%.dll$", ".lib") + elseif target:is_plat("mingw") then + libfile = libfile:gsub("%.dll$", ".dll.a") + end return {TARGETNAME = target:name(), PROJECTNAME = project.name() or target:name(), - TARGETFILENAME = target:is_plat("windows", "mingw") and path.filename(target:targetfile()):gsub("%.dll$", ".lib") or path.filename(target:targetfile()), + TARGETFILENAME = libfile, TARGETKIND = target:is_shared() and "SHARED" or "STATIC", PACKAGE_VERSION = target:get("version") or "1.0.0", TARGET_PTRBYTES = target:is_arch("x86", "i386") and "4" or "8"} |
