Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xmake-io/luarocks-build-xmake
A luarocks build module based on xmake
https://github.com/xmake-io/luarocks-build-xmake
cplusplus lua luarocks makefile xmake
Last synced: 3 months ago
JSON representation
A luarocks build module based on xmake
- Host: GitHub
- URL: https://github.com/xmake-io/luarocks-build-xmake
- Owner: xmake-io
- License: apache-2.0
- Created: 2021-01-16T14:17:17.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-16T14:22:08.000Z (almost 4 years ago)
- Last Synced: 2024-08-07T18:38:38.148Z (6 months ago)
- Topics: cplusplus, lua, luarocks, makefile, xmake
- Language: Lua
- Homepage: https://xmake.io
- Size: 159 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Introduction ([中文](/README_zh.md))
A fork of built-in build system for C++ rocks. Specify "xmake" as build type and "luarocks-build-xmake" as dependency to use it.
About xmake, please see [xmake](https://github.com/xmake-io/xmake).
## 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.
```lua
add_rules("mode.debug", "mode.release")target("example1.hello")
add_rules("luarocks.module")
add_files("src/test.c")
```#### rockspec
```lua
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
```lua
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 = {}
}
```## Set special xmake version
```lua
dependencies = {
"lua >= 5.1",
"luarocks-build-xmake"
}
build = {
type = "xmake",
variables = {
xmake = {
version = "2.5.1"
}
},
copy_directories = {}
}
```## Set xmake compilation configuration
```lua
dependencies = {
"lua >= 5.1",
"luarocks-build-xmake"
}
build = {
type = "xmake",
variables = {
xmake = {
plat = "mingw",
arch = "x86_64",
mode = "debug",
cflags = "-DTEST1",
cc = "gcc",
ld = "gcc",
ldflags = "...",
mingw = "mingw sdk path",
vs = "2019",
vs_runtime = "MT",
vs_toolset = "",
vs_sdkver = "",
}
},
copy_directories = {}
}
```