diff options
| author | ruki <[email protected]> | 2017-06-14 19:50:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-14 19:50:21 +0800 |
| commit | 75a12f5e305adfa4fd7d3bb8abb13ec8460a4df8 (patch) | |
| tree | d608ff825a633fdb8b3a7ed991745f1245572b20 | |
| parent | 8c26570e658b2a458db92fd2ffc8906e905c1ca1 (diff) | |
improve find_package on linux
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_package.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_package.lua b/xmake/core/sandbox/modules/import/lib/detect/find_package.lua index 98c233392..0bc4bcd26 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_package.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_package.lua @@ -79,17 +79,22 @@ function sandbox_lib_detect_find_package._find_from_systemdirs(name, opt) -- add default search pathes on pc host local pathes = {} - if (opt.plat == "linux" or opt.plat == "macosx") then + if opt.plat == "linux" or opt.plat == "macosx" then table.insert(pathes, "/usr/local/lib") table.insert(pathes, "/usr/lib") table.insert(pathes, "/opt/local/lib") table.insert(pathes, "/opt/lib") + if opt.plat == "linux" and opt.arch == "x86_64" then + table.insert(pathes, "/usr/local/lib/x86_64-linux-gnu") + table.insert(pathes, "/usr/lib/x86_64-linux-gnu") + end end -- attempt to get links from pkg-config + local pkginfo = nil local links = opt.links if not links then - local pkginfo = pkg_config.info(name) + pkginfo = pkg_config.info(name) if pkginfo then links = pkginfo.links end @@ -106,6 +111,11 @@ function sandbox_lib_detect_find_package._find_from_systemdirs(name, opt) end end + -- not found? only add links + if not result and pkginfo and pkginfo.links then + result = {links = pkginfo.links} + end + -- ok return result end |
