summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-21 00:39:47 +0800
committerruki <[email protected]>2022-05-21 00:39:47 +0800
commit8a3cf441ff712130e7f1eede1c80c89997443bbf (patch)
treec9899023757cd4e3917ba3ec09a39425999a5de3
parentbbafe9a6f5fd1afc54a879ffa7cffe7cd3807eb8 (diff)
add ccache dir
-rw-r--r--xmake/actions/config/xmake.lua5
-rw-r--r--xmake/modules/private/cache/build_cache.lua3
2 files changed, 5 insertions, 3 deletions
diff --git a/xmake/actions/config/xmake.lua b/xmake/actions/config/xmake.lua
index 67d0af595..3b81d88b6 100644
--- a/xmake/actions/config/xmake.lua
+++ b/xmake/actions/config/xmake.lua
@@ -210,14 +210,15 @@ task("config")
{category = "Other Configuration"},
{nil, "debugger", "kv", "auto" , "Set debugger"},
{nil, "ccache", "kv", true , "Enable or disable the c/c++ compiler cache."},
- {nil, "trybuild", "kv", nil , "Enable try-build mode and set the third-party buildsystem tool.",
+ {nil, "ccachedir", "kv", nil , "Set the ccache directory."},
+ {nil, "trybuild", "kv", nil , "Enable try-build mode and set the third-party buildsystem tool.",
"e.g.",
" - xmake f --trybuild=auto; xmake",
" - xmake f --trybuild=autotools -p android --ndk=xxx; xmake",
"",
"the third-party buildsystems:"
, values = {"auto", "make", "autotools", "cmake", "scons", "meson", "bazel", "ninja", "msbuild", "xcodebuild", "ndkbuild"}},
- {nil, "tryconfigs", "kv", nil , "Set the extra configurations of the third-party buildsystem for the try-build mode.",
+ {nil, "tryconfigs", "kv", nil , "Set the extra configurations of the third-party buildsystem for the try-build mode.",
"e.g.",
" - xmake f --trybuild=autotools --tryconfigs='--enable-shared=no'"},
{'o', "buildir", "kv", "build" , "Set build directory."},
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua
index 62e3cae98..3d207d456 100644
--- a/xmake/modules/private/cache/build_cache.lua
+++ b/xmake/modules/private/cache/build_cache.lua
@@ -67,7 +67,8 @@ end
-- get cache root directory
function rootdir()
- return path.join(config.buildir(), ".build_cache")
+ local cachedir = config.get("cachedir")
+ return cachedir or path.join(config.buildir(), ".build_cache")
end
-- clean cached files