diff options
| author | ruki <[email protected]> | 2022-10-14 22:30:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-14 22:30:22 +0800 |
| commit | 554ab8a3cdb805efc83870d22d01790df4e55782 (patch) | |
| tree | b31deff68a17b6bdc73a64acdff474892c84d13d | |
| parent | 455d516884ff4d69b47d967c63b89281319612c9 (diff) | |
improve tools/xmake
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index 5935aa58f..bcef47abe 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("core.base.global") import("core.tool.toolchain") import("core.project.project") import("core.package.repository") @@ -139,6 +140,13 @@ end -- set some builtin global options from the parent xmake function _set_builtin_argv(argv) + -- if the package cache directory is modified, + -- we need to force the project directory to be specified to avoid interference by the upper level xmake.lua. + local cachedir = os.getenv("XMAKE_PKG_CACHEDIR") or global.get("pkg_cachedir") + if cachedir then + table.insert(argv, "-P") + table.insert(argv, os.curdir()) + end for _, name in ipairs({"diagnosis", "verbose", "quiet", "yes", "confirm", "root"}) do local value = option.get(name) if type(value) == "boolean" then |
