diff options
| author | ruki <[email protected]> | 2022-02-25 00:27:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-02-25 00:27:11 +0800 |
| commit | dde475a0406409cab324728c143646b34faea1e1 (patch) | |
| tree | e0b465fb2c253cb2cf6b0bddbaead3684767bdf0 | |
| parent | 31cc6787821f65e077ac90d9a2fa04c5c7a0f2e7 (diff) | |
fix xrepo install
| -rw-r--r-- | xmake/modules/private/xrepo/action/fetch.lua | 11 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/install.lua | 18 |
2 files changed, 13 insertions, 16 deletions
diff --git a/xmake/modules/private/xrepo/action/fetch.lua b/xmake/modules/private/xrepo/action/fetch.lua index 94a7bb709..686f6d95a 100644 --- a/xmake/modules/private/xrepo/action/fetch.lua +++ b/xmake/modules/private/xrepo/action/fetch.lua @@ -122,7 +122,7 @@ function _fetch_packages(packages) end -- do configure first - local config_argv = {"f", "-c"} + local config_argv = {"f", "-c", "--require=n"} if option.get("verbose") then table.insert(config_argv, "-v") end @@ -204,11 +204,12 @@ function _fetch_packages(packages) raise(errors) end end - if extra then - local extra_str = string.serialize(extra, {indent = false, strip = true}) - table.insert(require_argv, "--extra=" .. extra_str) - end if not packagefile then + -- avoid to override extra configs in add_requires/xmake.lua + if extra then + local extra_str = string.serialize(extra, {indent = false, strip = true}) + table.insert(require_argv, "--extra=" .. extra_str) + end table.join2(require_argv, packages) end os.vexecv("xmake", require_argv, {envs = envs}) diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua index e1849eb3d..5c15a7294 100644 --- a/xmake/modules/private/xrepo/action/install.lua +++ b/xmake/modules/private/xrepo/action/install.lua @@ -140,7 +140,7 @@ function _install_packages(packages) os.setenv("XMAKE_STATS", "false") -- do configure first - local config_argv = {"f", "-c"} + local config_argv = {"f", "-c", "--require=n"} if option.get("verbose") then table.insert(config_argv, "-v") end @@ -204,12 +204,7 @@ function _install_packages(packages) if #rcfiles > 0 then envs.XMAKE_RCFILES = path.joinenv(rcfiles) end - if packagefile then - -- https://github.com/xmake-io/xmake/issues/2084 - os.execv("xmake", config_argv, {envs = envs}) - else - os.vrunv("xmake", config_argv, {envs = envs}) - end + os.vrunv("xmake", config_argv, {envs = envs}) -- do install local require_argv = {"require"} @@ -257,12 +252,13 @@ function _install_packages(packages) raise(errors) end end - if extra then - local extra_str = string.serialize(extra, {indent = false, strip = true}) - table.insert(require_argv, "--extra=" .. extra_str) - end if not packagefile then + -- avoid to override extra configs in add_requires/xmake.lua table.join2(require_argv, packages) + if extra then + local extra_str = string.serialize(extra, {indent = false, strip = true}) + table.insert(require_argv, "--extra=" .. extra_str) + end end os.vexecv("xmake", require_argv, {envs = envs}) end |
