From aec56a9489a2df46d675589fb98b056a4dd2aca4 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sat, 30 Aug 2025 09:32:32 +0800 Subject: Check policies before accessing build cache settings --- xmake/modules/package/tools/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index f37ab1ab5..e2b22f926 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -280,7 +280,7 @@ function _get_configs(package, configs, opt) if not package:use_external_includes() and (not policies or not policies:find("package.include_external_headers", 1, true)) then table.insert(policies_list, "package.include_external_headers:n") end - if policies:find("package.build.ccache", 1, true) then + if policies and policies:find("package.build.ccache", 1, true) then table.insert(configs, "--ccachedir=" .. path.join(path.directory(package:cachedir()), "build_cache")) table.insert(policies_list, "build.ccache") end -- cgit v1.3.1