File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,15 @@ fn main() {
2424 #[ cfg( feature = "patched" ) ]
2525 panic ! ( "Invalid configuration for libquickjs-sys: the patched feature is incompatible with the system feature" ) ;
2626
27- let lib = if cfg ! ( unix) {
27+ let lib: std:: borrow:: Cow < str > = if let Ok ( lib) = env:: var ( "QUICKJS_LIBRARY_PATH" ) {
28+ lib. into ( )
29+ } else if cfg ! ( unix) {
2830 if exists ( format ! ( "/usr/lib/quickjs/{}.a" , LIB_NAME ) ) {
29- "/usr/lib/quickjs"
31+ "/usr/lib/quickjs" . into ( )
3032 } else if exists ( "/usr/local/lib/quickjs" ) {
31- "/usr/local/lib/quickjs"
33+ "/usr/local/lib/quickjs" . into ( )
3234 } else {
33- panic ! ( "quickjs is not supported on this platform " ) ;
35+ panic ! ( "quickjs library could not be found. Try setting the QUICKJS_LIBRARY_PATH env variable " ) ;
3436 }
3537 } else {
3638 panic ! ( "quickjs error: Windows is not supported yet" ) ;
You can’t perform that action at this time.
0 commit comments