Skip to content

Provide some xmake variables for install #6

@Freed-Wu

Description

@Freed-Wu

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

Currently, luarocks build backend for xmake just run xmake install -o output, then install output/lib and lua. Perhaps we can provide more flexible method, provide some variables in xmake:

xmake.lua:

target("bar")
do
    set_prefixdir("$(prefix)/lib", { libdir = "foo" })
    add_rules("lua.module")
    add_files("*.c")
    add_installfiles("usage.md", {prefixdir= "$(prefix)/doc"})
    add_installfiles("example.conf", {prefixdir= "$(prefix)/conf"})
    add_installfiles("(foo/init.lua)", {prefixdir= "$(prefix)/lua"})
end
$ find .
lib/foo/bar.so
lua/foo/init.lua
conf/example.conf
doc/usage.md

Describe the solution you'd like

not directly load user's xmake.lua, we generate a xmake.lua and load it:

option("prefix")
do
    set_default("XXX")
end
includes"/the/path/of/user's/xmake.lua"

Then user can use $(prefix) or more xmake variables in their xmake.lua.

Describe alternatives you've considered

Or xmake support directly pass options. xmake f -D prefix=XXX user's/xmake.lua. like cmake -D.

Additional context

Here is similar thought for python backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions