summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-27 22:55:23 +0800
committerruki <[email protected]>2024-07-27 22:55:23 +0800
commite63b39cbf9a600115ecf0ee348e4eab5d7025034 (patch)
tree6a32ee22b8706cd769ee258befa2073ce7af6ced
parenta766d76d6b3f43c4fa2058f59c565c46a59b1118 (diff)
fix fetch sysincludedirs
-rw-r--r--xmake/core/package/package.lua7
-rw-r--r--xmake/modules/package/tools/autoconf.lua4
-rw-r--r--xmake/modules/package/tools/cmake.lua4
-rw-r--r--xmake/modules/package/tools/meson.lua4
4 files changed, 11 insertions, 8 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index fdfa59a42..b1da1c19e 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1931,7 +1931,8 @@ function _instance:fetch(opt)
-- attempt to get it from cache
local fetchinfo = self._FETCHINFO
- if not opt.force and opt.external == nil and opt.system == nil and fetchinfo then
+ local usecache = opt.external == nil and opt.system == nil
+ if not opt.force and usecache and fetchinfo then
return fetchinfo
end
@@ -2026,7 +2027,9 @@ function _instance:fetch(opt)
end
-- save to cache
- self._FETCHINFO = fetchinfo
+ if usecache then
+ self._FETCHINFO = fetchinfo
+ end
-- we need to update the real version if it's system package
-- @see https://github.com/xmake-io/xmake/issues/3333
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua
index 7636cad60..0b1512d52 100644
--- a/xmake/modules/package/tools/autoconf.lua
+++ b/xmake/modules/package/tools/autoconf.lua
@@ -185,7 +185,7 @@ function _get_cflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _map_compflags(package, "cxx", "define", fetchinfo.defines))
table.join2(result, _translate_paths(_map_compflags(package, "cxx", "includedir", fetchinfo.includedirs)))
@@ -202,7 +202,7 @@ function _get_ldflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "linkdir", fetchinfo.linkdirs)))
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "link", fetchinfo.links))
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 77c0f6228..3d8701297 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -104,7 +104,7 @@ function _get_cflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _map_compflags(package, "cxx", "define", fetchinfo.defines))
table.join2(result, _translate_paths(_map_compflags(package, "cxx", "includedir", fetchinfo.includedirs)))
@@ -121,7 +121,7 @@ function _get_ldflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _translate_paths(_map_linkflags(package, "binary", {"cxx"}, "linkdir", fetchinfo.linkdirs)))
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "link", fetchinfo.links))
diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua
index fae75af6e..a9ab53ba6 100644
--- a/xmake/modules/package/tools/meson.lua
+++ b/xmake/modules/package/tools/meson.lua
@@ -400,7 +400,7 @@ function _get_cflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _map_compflags(package, "cxx", "define", fetchinfo.defines))
table.join2(result, _map_compflags(package, "cxx", "includedir", fetchinfo.includedirs))
@@ -417,7 +417,7 @@ function _get_ldflags_from_packagedeps(package, opt)
for _, depname in ipairs(opt.packagedeps) do
local dep = type(depname) ~= "string" and depname or package:dep(depname)
if dep then
- local fetchinfo = dep:fetch({external = false})
+ local fetchinfo = dep:fetch()
if fetchinfo then
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "linkdir", fetchinfo.linkdirs))
table.join2(result, _map_linkflags(package, "binary", {"cxx"}, "link", fetchinfo.links))