Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcpkg manifest 模式下支持自定义 vcpkg-configuration.json #2469

Closed
BenzzzX opened this issue Jun 17, 2022 · 6 comments
Closed

vcpkg manifest 模式下支持自定义 vcpkg-configuration.json #2469

BenzzzX opened this issue Jun 17, 2022 · 6 comments

Comments

@BenzzzX
Copy link

BenzzzX commented Jun 17, 2022

Is your feature request related to a problem? Please describe.

vcpkg 支持外部 registry,registry 的配置存放在与 vcpkg.json 同一目录下的 vcpkg-configuration.json 中,目前 xmake 可以生成 vcpkg.json,但没办法自定义 vcpkg-configuration.json。

Describe the solution you'd like

提供自定义 vcpkg-configuration.json 的方式。比如直接拷贝根目录下的 vcpkg-configuration.json 到编译目录。

Describe alternatives you've considered

No response

Additional context

No response

@waruqi
Copy link
Member

waruqi commented Jun 20, 2022

能搞个简单的 demo 么。。我这方便测试

@BenzzzX
Copy link
Author

BenzzzX commented Jun 20, 2022

tmp.zip
使用 vcpkg install 可以找到对应的 package。我改了一下 xmake 增加了

local configuration = path.join(os.projectdir(), "vcpkg-configuration.json")
if os.exists(configuration) then
    vprint(configuration)
    os.cp(configuration, installdir)
end

也可以找到 package

@waruqi
Copy link
Member

waruqi commented Jun 20, 2022

local registries = {
    {
        kind = "git",
        repository = "https://github.com/SakuraEngine/vcpkg-registry",
        baseline = "e0e1e83ec66e3c9b36066f79d133b01eb68049f7",
        packages = {
            "skrgamenetworkingsockets"
        }
    }
}
add_requires("vcpkg::skrgamenetworkingsockets >=1.4.0+1", {configs = {registries = registries}})

试下,dev。。

增加了 registries 和 default_registries 配置,可以把 vcpkg-configuartion.json 里面的原样搬过去,不过要转成 lua table

@waruqi waruqi added this to the v2.6.8 milestone Jun 20, 2022
@BenzzzX
Copy link
Author

BenzzzX commented Jun 20, 2022

牛逼,成了,不过 modules\package\manager\vcpkg\configurations.lua 少写了一个逗号,我加上逗号成了

@waruqi
Copy link
Member

waruqi commented Jun 20, 2022

再试下

@waruqi
Copy link
Member

waruqi commented Jun 21, 2022

应该可以了对吧,我先关了

@waruqi waruqi closed this as completed Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants