From 1807fa789ca8b19a86de4465bb26aa47715cdc4f Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sat, 7 May 2022 16:20:57 +0100 Subject: Don't require Lua sources for modules in build system --- build/find_dummy.rs | 2 +- build/find_normal.rs | 2 ++ build/find_vendored.rs | 3 ++- build/main.rs | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/find_dummy.rs b/build/find_dummy.rs index 70aab9f..d8ad44b 100644 --- a/build/find_dummy.rs +++ b/build/find_dummy.rs @@ -1,5 +1,5 @@ use std::path::PathBuf; pub fn probe_lua() -> Option { - unreachable!() + None } diff --git a/build/find_normal.rs b/build/find_normal.rs index 709fc1b..3e72609 100644 --- a/build/find_normal.rs +++ b/build/find_normal.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use std::env; use std::ops::Bound; use std::path::PathBuf; diff --git a/build/find_vendored.rs b/build/find_vendored.rs index d516dfd..5b7b8e1 100644 --- a/build/find_vendored.rs +++ b/build/find_vendored.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use std::path::PathBuf; pub fn probe_lua() -> Option { @@ -20,7 +22,6 @@ pub fn probe_lua() -> Option { #[cfg(feature = "luau")] let artifacts = luau0_src::Build::new().build(); - #[cfg(not(feature = "module"))] artifacts.print_cargo_metadata(); Some(artifacts.include_dir().to_owned()) diff --git a/build/main.rs b/build/main.rs index bdbe664..5cb979a 100644 --- a/build/main.rs +++ b/build/main.rs @@ -105,6 +105,10 @@ fn main() { + "Please, use `pkg-config` or custom mode to link to a Lua dll." ); + #[cfg(all(feature = "luau", feature = "module"))] + compile_error!("Luau does not support module mode"); + + #[cfg(any(not(feature = "module"), target_os = "windows"))] find::probe_lua(); println!("cargo:rerun-if-changed=build"); -- cgit v1.2.3