From 7ed6f98c2ebfead99b45fb7f4af369b3b47b2618 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 14 Oct 2020 23:22:04 +0800 Subject: improve find_package --- xmake/modules/package/manager/xmake/find_package.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmake/modules/package/manager/xmake/find_package.lua b/xmake/modules/package/manager/xmake/find_package.lua index fce6429f7..9ef351a87 100644 --- a/xmake/modules/package/manager/xmake/find_package.lua +++ b/xmake/modules/package/manager/xmake/find_package.lua @@ -62,10 +62,12 @@ function _find_package_from_repo(name, opt) for _, includedir in ipairs(vars.includedirs) do table.insert(includedirs, path.join(installdir, includedir)) end - if #includedirs == 0 then + if #includedirs == 0 and os.isdir(path.join(installdir, "include")) then table.insert(includedirs, path.join(installdir, "include")) end - result.includedirs = table.unique(includedirs) + if #includedirs > 0 then + result.includedirs = table.unique(includedirs) + end -- get links and link directories local links = {} -- cgit v1.3.1