summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorCherichy <[email protected]>2021-12-14 17:05:05 +0800
committerGitHub <[email protected]>2021-12-14 17:05:05 +0800
commitfd0a6c6821b5eff6ce4c945ffba1bfbb416f6031 (patch)
tree86a7496a7ae13df1035b3e20f3cfa55cdbffda51 /xmake/modules
parent87f599c961f5cbd8a8af63cb4ce3935357e130ee (diff)
Fix cmake find bug on windows.
在windows上由于issue 1822 添加了对ImportLibrary的查找,在vcproj里面会有一个与项目同名的lib文件也被加入到link目录。 比如find_package cmake::OpenCV 会导致需要link一个名为OpenCV.lib的文件,但实际上并不存在这一文件,所以需要将其排除。
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/manager/cmake/find_package.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/cmake/find_package.lua b/xmake/modules/package/manager/cmake/find_package.lua
index e4099f73d..0dd5751a4 100644
--- a/xmake/modules/package/manager/cmake/find_package.lua
+++ b/xmake/modules/package/manager/cmake/find_package.lua
@@ -201,7 +201,7 @@ function _find_package(cmake, name, opt)
-- get links and linkdirs
local linkdir = path.directory(library)
- if linkdir ~= "." then
+ if linkdir ~= "." and string.find(string.gsub(linkdir,"/","\\"),workdir) == nil then
linkdirs = linkdirs or {}
table.insert(linkdirs, linkdir)
local link = target.linkname(path.filename(library))