summaryrefslogtreecommitdiff
path: root/build/find_vendored.rs
blob: a1bb76a78c03427e386a6f4c1e5e5511f15656b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::path::PathBuf;

#[cfg(feature = "lua-vendored")]
use lua_src;
#[cfg(feature = "luajit-vendored")]
use luajit_src;

pub fn probe_lua() -> PathBuf {
    #[cfg(all(feature = "lua53", feature = "lua-vendored"))]
    let artifacts = lua_src::Build::new().build(lua_src::Lua53);
    #[cfg(all(feature = "lua52", feature = "lua-vendored"))]
    let artifacts = lua_src::Build::new().build(lua_src::Lua52);
    #[cfg(all(feature = "lua51", feature = "lua-vendored"))]
    let artifacts = lua_src::Build::new().build(lua_src::Lua51);
    #[cfg(feature = "luajit-vendored")]
    let artifacts = luajit_src::Build::new().build();

    #[cfg(all(feature = "luajit", feature = "lua-vendored"))]
    let artifacts = lua_src::Build::new().build(lua_src::Lua51); // Invalid case! Workaround to get panic

    artifacts.print_cargo_metadata();
    artifacts.include_dir().to_owned()
}