diff options
| author | ruki <[email protected]> | 2022-10-13 23:28:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-13 23:28:34 +0800 |
| commit | 34ee1de74fbd88bb92fa4aa7d399ab2b657f9d17 (patch) | |
| tree | 957f4070d9a7daeda9587873e17008ab08c59958 | |
| parent | e4950610568e270b3cdd106ab278b7a7989f7861 (diff) | |
improve xrepo export
| -rw-r--r-- | xmake/modules/private/xrepo/action/export.lua | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/xmake/modules/private/xrepo/action/export.lua b/xmake/modules/private/xrepo/action/export.lua index ac6b98594..89d34ed75 100644 --- a/xmake/modules/private/xrepo/action/export.lua +++ b/xmake/modules/private/xrepo/action/export.lua @@ -42,6 +42,7 @@ function menu_options() " - xrepo export -f \"vs_runtime='MD'\" zlib", " - xrepo export -f \"regex=true,thread=true\" boost"}, {}, + {nil, "includes", "kv", nil, "Includes extra lua configuration files."}, {nil, "toolchain", "kv", nil, "Set the toolchain name." }, {nil, "shallow", "k", nil, "Does not export dependent packages."}, {'o', "packagedir", "kv", "packages","Set the exported packages directory."}, @@ -86,8 +87,15 @@ function _export_packages(packages) end end - local oldir = os.curdir() + -- add includes to rcfiles + local rcfiles = {} + local includes = option.get("includes") + if includes then + table.join2(rcfiles, path.splitenv(includes)) + end + -- enter working project directory + local oldir = os.curdir() local subdir = "working" if packagefile then subdir = subdir .. "-" .. hash.uuid(packagefile):split('-')[1] @@ -131,7 +139,11 @@ function _export_packages(packages) table.insert(config_argv, "-k") table.insert(config_argv, kind) end - os.vrunv("xmake", config_argv) + local envs = {} + if #rcfiles > 0 then + envs.XMAKE_RCFILES = path.joinenv(rcfiles) + end + os.vrunv("xmake", config_argv, {envs = envs}) -- do export local require_argv = {"require", "--export"} @@ -179,7 +191,7 @@ function _export_packages(packages) end table.join2(require_argv, packages) end - os.vexecv("xmake", require_argv) + os.vexecv("xmake", require_argv, {envs = envs}) end -- export packages in current project |
