-
-
Notifications
You must be signed in to change notification settings - Fork 775
-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Add a way to ask xmake to try to download dependencies from a certain package manager #1140
Comments
I think only need to modify the xmake.lua configuration to support it. add_requires("pacman::zlib", {group = "zlib"})
add_requires("zlib", {group = "zlib"})
target("xxx")
if has_package("pacman::zlib") then
add_packages("pacman::zib")
else
add_packages("zlib")
end |
The problem is that each project manager has to add those It would really easy to juste have something like:
And inside each if(prefPkgMan == "pacman")
-- try to use pacman
else if (prefPkgMan == "conan")
-- try to use conan
end
-- if pacman or conan failed, use xmake-repo |
Because even the same package, the configuration in each package manager may be different, and even the package name may be different xmake cannot handle them automatically, unless the user uses add_requires to explicitly configure which package manager to use. In addition, using add_requires("xxx"), xmake will first automatically find and use their packages from various package managers such as pacman, brew, pkg-config, etc. If users don’t want to download packages from xmake-repo, they can directly use brew/pacman to install these packages, so users do not need to modify xmake.lua |
you can see #1239 |
I have supported it on this pr: #1429 we need add some extsources in packages. package("fmt")
if is_plat("macosx") then
add_extsources("brew::fmt")
end and xmake.lua add_requires("fmt")
target("test")
-- ...
add_packages("fmt") Then run xmake and input $ xmake
note: install or modify (m) these packages (pass -y to skip confirm)?
in local-repo:
-> fmt 7.1.3
please input: y (y/n/m)
m
note: select the following 3rd packages
1. brew::fmt -> fmt 7.1.3
please input number list: n (1,2,..)
1
note: install or modify (m) these packages (pass -y to skip confirm)?
in brew:
-> brew::fmt latest
please input: y (y/n/m)
y
=> install brew::fmt latest .. ok
[ 25%]: ccache compiling.release src/main.cpp
[ 50%]: linking.release test
[100%]: build ok! |
Describe the solution you'd like
Currently, one have to add the prefix
pacman::
in front of required librairies to download them using msys on windows. But what happens if a library is available on msys, on conan or on vcpkg and one wants to let the user choose from which package manager the library will be downloaded?It could be great to add an option from command-line to tell xmake "try first to download dependencies from this package manager, if it does not work, build them using xmake-repo", so that the user is not forced to modify the xmake.lua to do so.
The text was updated successfully, but these errors were encountered: