Skip to content

Commit 193d779

Browse files
authored
Merge pull request #14 from pgvee/master
Workaround CMAKE/MSVC issue
2 parents 1381342 + cef5bbc commit 193d779

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

ui-sys/build.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,10 @@ fn main() {
2828

2929
// Build libui if needed. Otherwise, assume it's in lib/
3030
let mut dst;
31-
let mut msvc = false;
3231
if cfg!(feature = "build") {
33-
dst = Config::new("libui").build_target("").build();
34-
// Deterimine if we're building for MSVC
35-
let target = env::var("TARGET").unwrap();
36-
msvc = target.contains("msvc");
32+
dst = Config::new("libui").build_target("").profile("release").build();
3733

38-
let mut postfix = Path::new("build").join("out");
39-
if msvc {
40-
postfix = postfix.join(
41-
if cfg!(debug_assertions) { "Debug" } else {"Release"}
42-
);
43-
}
34+
let postfix = Path::new("build").join("out");
4435
dst = dst.join(&postfix);
4536
} else {
4637
dst = env::current_dir()
@@ -49,6 +40,10 @@ fn main() {
4940
}
5041
println!("cargo:rustc-link-search=native={}", dst.display());
5142

43+
// Deterimine if we're building for MSVC
44+
let target = env::var("TARGET").unwrap();
45+
let msvc = target.contains("msvc");
46+
5247
let libname;
5348
if msvc {
5449
libname = "libui";

0 commit comments

Comments
 (0)