-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
Packages cannot expose existing rules in libraries that use xmake #5746
Comments
you can try to copy rule script files of your xmake project to package("xxx")
on_install(function (package)
os.cp("plugin/*.lua", package:installdir("rules"))
end) like this.
|
This doesn't seem very clean, not to mention I'd have to do a text replace on an rules to rename them, otherwise in my example consumers would have to do There's also the additional problem where rules that need to use rule("commonlibsse.plugin")
...
target:extraconf("rules", "commonlibsse.plugin") vs in a package: rule("plugin")
...
target:extraconf("rules", "@commonlibsse/plugin") |
If you distribute rules through packages, you must add the package name prefix, |
yes, that's what I said, that's a problem here |
try or you can patch it when install them |
There needs to be better integration than just manually patching |
How about having some kind of rule object passed by xmake in callbacks? like: rule("commonlibsse.plugin")
on_config(function(target, opt)
local conf = target:extraconf("rules", opt.rule:name()) -- or even opt.rule:targetconf(target) |
Is your feature request related to a problem? Please describe.
As described here, I feel that using rules through packages are held back by the fact that you cannot re-use existing rules in an xmake based library.
A good example is the
commonlibsse-ng
package I made and pr'd here a long while back. I haven't updated the package because I felt that using it as a git submodule instead had more immediate benefits, of which include using thecommonlibsse.plugin
rule is one of them.It is defined here:
https://github.com/qudix/commonlibsse/blob/dev/xmake-extra.lua#L83
And used in this template here:
https://github.com/qudix/commonlibsse-template/blob/main/xmake.lua#L32
Describe the solution you'd like
Some way to explicitly expose specific rules in an xmake library to package consumers without having to copy and paste those rules again into the package definition.
Perhaps something like:
which would grab the rule defined as
commonlibsse.plugin
in the libraries ownxmake.lua
or other included script, and expose it to the consumer who can then use it as@commonlibsse/plugin
this ignores a lot of the complexity as I'm not familiar enough with the xmake codebase to know of a better way to do this.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: