diff options
| author | star9029 <[email protected]> | 2025-08-29 23:57:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-29 23:57:54 +0800 |
| commit | e8fd1bf73014437fdaa86a0be38f91f90b1fd718 (patch) | |
| tree | 5f5fa1b46ed1912054e5cd9988d12fbcf91660d0 | |
| parent | bdb88d2f6a7c8118018c701c9bd96d0c086ed8f3 (diff) | |
Use ccache when debug xmake package
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index b572c2fec..cf136d562 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -291,6 +291,12 @@ function _get_configs(package, configs, opt) policies = "package.include_external_headers:n" end end + if policies:find("package.build.ccache", 1, true) then + table.insert(configs, "--ccachedir=" .. path.join(path.directory(package:cachedir()), "build_cache")) + policies = policies .. ",build.ccache:y" + else + policies = policies .. ",build.ccache:n" + end if policies then table.insert(configs, "--policies=" .. policies) end @@ -513,7 +519,6 @@ function install(package, configs, opt) -- we need to put `-P` in the first argument of _set_builtin_argv() to avoid option.parse() parsing errors local argv = {"f"} _set_builtin_argv(package, argv) - table.insert(argv, "-y") table.insert(argv, "-c") for name, value in pairs(_get_configs(package, configs, opt)) do value = tostring(value):trim() |
