diff options
| author | ruki <[email protected]> | 2022-06-21 00:53:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-06-21 00:53:44 +0800 |
| commit | 9dabe5290dc38e5f543c9e582b5be13f5afae41d (patch) | |
| tree | d4fefe6eeb85e76e621ac6383b952d47f562b396 | |
| parent | 47d44450f181dff85b6e77f02f184b0044604197 (diff) | |
update changelog
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/configurations.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 9 |
3 files changed, 15 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 53bb37989..962c8e02e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [#2447](https://github.com/xmake-io/xmake/pull/2447): Add qt.qmlplugin rule and support of qmltypesregistrar * [#2446](https://github.com/xmake-io/xmake/issues/2446): Support target group for `xmake install` +* [#2469](https://github.com/xmake-io/xmake/issues/2469): Generate vcpkg-configuration.json ### Changes @@ -1315,6 +1316,7 @@ * [#2447](https://github.com/xmake-io/xmake/pull/2447): 添加 qt.qmlplugin 规则和 qmltypesregistrar 支持 * [#2446](https://github.com/xmake-io/xmake/issues/2446): 支持 target 分组安装 +* [#2469](https://github.com/xmake-io/xmake/issues/2469): 产生 vcpkg-configuration.json ### 改进 diff --git a/xmake/modules/package/manager/vcpkg/configurations.lua b/xmake/modules/package/manager/vcpkg/configurations.lua index 9021edff0..60577efad 100644 --- a/xmake/modules/package/manager/vcpkg/configurations.lua +++ b/xmake/modules/package/manager/vcpkg/configurations.lua @@ -40,9 +40,11 @@ end -- get configurations function main() return { - baseline = {description = "set the builtin baseline."}, - features = {description = "set the features of dependency."}, - default_features = {description = "enables or disables any defaults provided by the dependency.", default = true} + baseline = {description = "set the builtin baseline."}, + features = {description = "set the features of dependency."}, + default_features = {description = "enables or disables any defaults provided by the dependency.", default = true}, + registries = {description = "set the registries in vcpkg-configuration.json"} + default_registries = {description = "set the default registries in vcpkg-configuration.json"} } end diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index 30a11f2e7..27d4a1d65 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -128,7 +128,7 @@ function _install_for_manifest(vcpkg, name, opt) overrides = {{name = name, version = require_version}} end - -- generate manifest + -- generate manifest, vcpkg.json local baseline = configs.baseline or "44d94c2edbd44f0c01d66c2ad95eb6982a9a61bc" -- 2021.04.30 local manifest = { name = "stub", @@ -146,6 +146,13 @@ function _install_for_manifest(vcpkg, name, opt) vprint(manifest) end + -- generate vcpkg-configuration.json + -- @see https://github.com/xmake-io/xmake/issues/2469 + if configs.registries or configs.default_registries then + local configuration = {registries = configs.registries, ["default-registries"] = configs.default_registries} + json.savefile(path.join(installdir, "vcpkg-configuration.json"), configuration) + end + -- install package os.vrunv(vcpkg, argv, {curdir = installdir}) end |
