Skip to content

Commit ea1475f

Browse files
committed
Same code from #17
these code is added to prevent conflicts from pgvee's PR #17, and for ci config test
1 parent 5a68a47 commit ea1475f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

ui-sys/build.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,32 @@ fn main() {
2626
}
2727
}
2828

29+
// Deterimine if we're building for MSVC
30+
let target = env::var("TARGET").unwrap();
31+
let msvc = target.contains("msvc");
2932
// Build libui if needed. Otherwise, assume it's in lib/
3033
let mut dst;
3134
if cfg!(feature = "build") {
3235
dst = Config::new("libui").build_target("").profile("release").build();
3336

34-
let postfix = Path::new("build").join("out");
37+
let mut postfix = Path::new("build").join("out");
38+
if msvc {
39+
postfix = postfix.join("Release");
40+
}
3541
dst = dst.join(&postfix);
3642
} else {
3743
dst = env::current_dir()
3844
.expect("Unable to retrieve current directory location.");
3945
dst.push("lib");
4046
}
41-
println!("cargo:rustc-link-search=native={}", dst.display());
4247

43-
// Deterimine if we're building for MSVC
44-
let target = env::var("TARGET").unwrap();
45-
let msvc = target.contains("msvc");
46-
4748
let libname;
4849
if msvc {
4950
libname = "libui";
5051
} else {
5152
libname = "ui";
5253
}
54+
55+
println!("cargo:rustc-link-search=native={}", dst.display());
5356
println!("cargo:rustc-link-lib={}", libname);
5457
}

ui-sys/src/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ extern {
211211

212212
pub enum uiEditableCombobox {}
213213

214-
#[link(name = "ui")]
214+
// #[link(name = "ui")]
215215
extern {
216216
pub fn uiNewEditableCombobox() -> *mut uiEditableCombobox;
217217
pub fn uiEditableComboboxAppend(c: *mut uiEditableCombobox, text: *const c_char);

ui-sys/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ extern {
220220

221221
pub enum uiEditableCombobox {}
222222

223-
#[link(name = "ui")]
223+
// #[link(name = "ui")]
224224
extern {
225225
pub fn uiNewEditableCombobox() -> *mut uiEditableCombobox;
226226
pub fn uiEditableComboboxAppend(c: *mut uiEditableCombobox, text: *const c_char);

0 commit comments

Comments
 (0)