From f75a7e64e5d370e0da29ea394d9a91c4436ce3c2 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Wed, 11 Aug 2021 20:47:15 +0800 Subject: constrain replace --- xmake/modules/target/action/install/cmake_importfiles.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/target/action/install/cmake_importfiles.lua b/xmake/modules/target/action/install/cmake_importfiles.lua index d311f19ce..1fb9ca5a6 100644 --- a/xmake/modules/target/action/install/cmake_importfiles.lua +++ b/xmake/modules/target/action/install/cmake_importfiles.lua @@ -25,7 +25,7 @@ import("core.project.project") function _get_builtinvars(target, installdir) return {TARGETNAME = target:name(), PROJECTNAME = project.name() or target:name(), - TARGETFILENAME = path.filename(target:targetfile()):replace("dll", "lib"), + TARGETFILENAME = is_plat("windows", "mingw") and path.filename(target:targetfile()):gsub(".dll$", ".lib") or path.filename(target:targetfile()), 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"} -- cgit v1.3.1