中文)
Introduction (A fork of built-in build system for C++ rocks. Specify "xmake" as build type and "luarocks-build-xmake" as dependency to use it.
Example1 (with xmake.lua)
We can build c/c++ modules if the project contain xmake.lua
├── src
│ ├── test.c
│ └── test.h
└── xmake.lua
xmake.lua
We need to use add_rules("luarocks.module")
to add build rules for luarocks modules.
add_rules("mode.debug", "mode.release")
target("example1.hello")
add_rules("luarocks.module")
add_files("src/test.c")
rockspec
package = "example1"
version = "1.0-1"
source = {
url = "git://github.com/xmake-io/luarocks-build-xmake",
tag = "example1"
}
dependencies = {
"lua >= 5.1",
"luarocks-build-xmake"
}
build = {
type = "xmake",
copy_directories = {}
}
Example2 (without xmake.lua)
We can use xmake as builtin build type to build c/c++ modules if the project does not contain xmake.lua
├── src
├── test.c
└── test.h
rockspec
package = "example2"
version = "1.0-1"
source = {
url = "git://github.com/xmake-io/luarocks-build-xmake",
tag = "example2"
}
dependencies = {
"lua >= 5.1",
"luarocks-build-xmake"
}
build = {
type = "xmake",
modules = {
["example2.hello"] = {
sources = "src/test.c"
}
},
copy_directories = {}
}