diff options
| author | ruki <[email protected]> | 2018-09-19 22:57:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-19 11:47:11 +0800 |
| commit | 0fadfe24d1a42bc7a969fcaa49a3f2a1767c85d1 (patch) | |
| tree | b21b9022fd48fd2c57cac476b78bf37de5ee4970 /xmake/core/package | |
| parent | 4ee805906a0dcf442a80e0bb072c538622bd2a32 (diff) | |
improve to find_package to find prefix directory
Diffstat (limited to 'xmake/core/package')
| -rw-r--r-- | xmake/core/package/package.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index a506a8751..643eaf146 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -294,8 +294,10 @@ end -- set the require info function _instance:requireinfo_set(requireinfo) self._REQUIREINFO = requireinfo - -- switch to local package if exists package configuration or debug package - if requireinfo and (requireinfo.config or requireinfo.debug) then + -- switch to local package if exists package configuration or debug package or limit version + local version = requireinfo and requireinfo.version or nil + local limitversion = version and version ~= "master" and version ~= "lastest" + if requireinfo and (requireinfo.config or requireinfo.debug or limitversion) then self._FROMKIND = "local" end end @@ -419,14 +421,12 @@ function _instance:fetch(opt) -- import find_package self._find_package = self._find_package or sandbox_module.import("lib.detect.find_package", {anonymous = true}) - -- TODO fetch it from the package directories first - --[[ - local packagedir = self:directory() - if not fetchinfo and packagedir then + -- fetch it from the prefix directories first + if not fetchinfo then -- add cache key to make a distinction with finding system package - fetchinfo = self._find_package(self:name(), {packagedirs = packagedir, system = false, cachekey = "package:fetch", force = opt.force}) + fetchinfo = self._find_package(self:name(), {prefixdirs = self:prefixdir(), system = false, cachekey = "package:fetch", force = opt.force}) if fetchinfo then fetchfrom = self._FROMKIND end - end]] + end -- fetch it from the system directories if not fetchinfo then |
