File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ extension = []
4343# Otherwise, links statically to `libsciter-gtk.so` or `libsciter.dylib`.
4444dynamic = []
4545
46+ # Only for windows static linking
47+ skia = []
48+
4649# Build this crate specifically for Sciter.Lite versions
4750# which are incompatible with the regular ones.
4851windowless = []
Original file line number Diff line number Diff line change 1+ #[ cfg( all( windows, not( feature = "dynamic" ) ) ) ]
2+ fn main ( ) {
3+ use std:: { env, path:: PathBuf } ;
4+ if let Ok ( path) = env:: var ( "SCITER_STATIC_LIBRARY" ) {
5+ let lib_dir = PathBuf :: from ( path) ;
6+ println ! ( "cargo:rustc-link-search=native={}" , lib_dir. display( ) ) ;
7+ println ! ( "cargo:rustc-link-lib=static:-bundle={}" , "sciter.static" ) ;
8+ if cfg ! ( feature = "skia" ) {
9+ println ! ( "cargo:rustc-link-lib=static:-bundle={}" , "atls" ) ;
10+ }
11+ println ! ( "cargo:rustc-link-lib={}" , "Comdlg32" ) ;
12+ println ! ( "cargo:rustc-link-lib={}" , "windowscodecs" ) ;
13+ println ! ( "cargo:rustc-link-lib={}" , "Wininet" ) ;
14+ } else {
15+ println ! ( "cargo:warning=Set SCITER_STATIC_LIBRARY to link static library" ) ;
16+ }
17+
18+ }
19+
20+ #[ cfg( not( all( windows, not( feature = "dynamic" ) ) ) ) ]
21+ fn main ( ) { }
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ pub use capi::scapi::{ISciterAPI};
129129use capi:: scgraphics:: SciterGraphicsAPI ;
130130use capi:: screquest:: SciterRequestAPI ;
131131
132- #[ cfg( windows) ]
132+ #[ cfg( all ( windows, feature = "dynamic" ) ) ]
133133mod ext {
134134 // Note:
135135 // Sciter 4.x shipped with universal "sciter.dll" library for different builds:
@@ -217,6 +217,13 @@ mod ext {
217217 }
218218}
219219
220+ #[ cfg( all( windows, not( feature = "dynamic" ) ) ) ]
221+ mod ext {
222+ use capi:: scapi:: { ISciterAPI } ;
223+
224+ extern "C" { pub fn SciterAPI ( ) -> * const ISciterAPI ; }
225+ }
226+
220227#[ cfg( all( feature = "dynamic" , unix) ) ]
221228mod ext {
222229 #![ allow( non_snake_case, non_camel_case_types) ]
You can’t perform that action at this time.
0 commit comments