You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's now possible to pull and build (default), build from the current
sources without pulling (--features="build"), or not build at all, in
which case a copy of `libui.so` must exist in ui-sys/lib or be available
in a standard shared library search location.
Closes#8
Copy file name to clipboardExpand all lines: ui-sys/build.rs
+38-17Lines changed: 38 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,52 @@ use std::path::Path;
6
6
use std::process::Command;
7
7
8
8
fnmain(){
9
-
// Update the submodule with libui if needed
10
-
if !Path::new("libui/.git").exists(){
11
-
Command::new("git").args(&["version"]).status().expect("Git does not appear to be installed. Git is required to build ui-sys; install Git or build ui-sys independently. Error");
12
-
Command::new("git").args(&["submodule","update","--init"]).status().expect("Unable to update Git submodules. Error");
13
-
}else{
14
-
Command::new("git").args(&["submodule","update","--recursive"]).status().expect("Unable to update Git submodules. Error");
9
+
// Fetch the submodule if needed
10
+
ifcfg!(feature = "fetch"){
11
+
// Init or update the submodule with libui if needed
12
+
if !Path::new("libui/.git").exists(){
13
+
Command::new("git")
14
+
.args(&["version"])
15
+
.status()
16
+
.expect("Git does not appear to be installed. Error");
17
+
Command::new("git")
18
+
.args(&["submodule","update","--init"])
19
+
.status()
20
+
.expect("Unable to init libui submodule. Error");
21
+
}else{
22
+
Command::new("git")
23
+
.args(&["submodule","update","--recursive"])
24
+
.status()
25
+
.expect("Unable to update libui submodule. Error");
26
+
}
15
27
}
16
28
17
-
let target = env::var("TARGET").unwrap();
18
-
let msvc = target.contains("msvc");
29
+
// Build libui if needed. Otherwise, assume it's in lib/
0 commit comments