From dcb2eae70d3c430ab896f6901b104db127df046f Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 11 Nov 2024 22:56:39 +0900 Subject: [PATCH] feat: support building on windows --- build.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.rs b/build.rs index 478b8bb..061756d 100644 --- a/build.rs +++ b/build.rs @@ -25,6 +25,11 @@ fn match_libname(name: &str) -> Option { // Trim the leading "lib" and trailing ".dylib" return Some(name[3..name.len() - 6].into()); } + if name.starts_with("liblldb") && name.ends_with(".lib") { + // windows will have liblldb.lib + // Trim the trailing ".lib" + return Some(name[0..name.len() - 4].into()); + } None } @@ -34,6 +39,7 @@ fn test_match_libname() { assert_eq!(match_libname("liblldb.so"), Some("lldb")); assert_eq!(match_libname("liblldb-3.8.so"), Some("lldb-3.8")); assert_eq!(match_libname("liblldbIntelFeatures.so"), None); + assert_eq!(match_libname("liblldb.lib"), Some("liblldb")); } fn get_compiler_config() -> Build {