File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -26,29 +26,33 @@ fn main() {
26
26
}
27
27
}
28
28
29
+ // Deterimine if we're building for MSVC
30
+ let target = env:: var ( "TARGET" ) . unwrap ( ) ;
31
+ let msvc = target. contains ( "msvc" ) ;
29
32
// Build libui if needed. Otherwise, assume it's in lib/
30
33
let mut dst;
31
34
if cfg ! ( feature = "build" ) {
32
35
dst = Config :: new ( "libui" ) . build_target ( "" ) . profile ( "release" ) . build ( ) ;
33
36
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
+ }
35
41
dst = dst. join ( & postfix) ;
36
42
} else {
37
43
dst = env:: current_dir ( )
38
44
. expect ( "Unable to retrieve current directory location." ) ;
39
45
dst. push ( "lib" ) ;
40
46
}
41
- println ! ( "cargo:rustc-link-search=native={}" , dst. display( ) ) ;
42
-
43
- // Deterimine if we're building for MSVC
44
- let target = env:: var ( "TARGET" ) . unwrap ( ) ;
45
- let msvc = target. contains ( "msvc" ) ;
47
+
46
48
47
49
let libname;
48
50
if msvc {
49
51
libname = "libui" ;
50
52
} else {
51
53
libname = "ui" ;
52
54
}
55
+
56
+ println ! ( "cargo:rustc-link-search=native={}" , dst. display( ) ) ;
53
57
println ! ( "cargo:rustc-link-lib={}" , libname) ;
54
58
}
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ extern {
211
211
212
212
pub enum uiEditableCombobox { }
213
213
214
- #[ link( name = "ui" ) ]
214
+ // #[link(name = "ui")]
215
215
extern {
216
216
pub fn uiNewEditableCombobox ( ) -> * mut uiEditableCombobox ;
217
217
pub fn uiEditableComboboxAppend ( c : * mut uiEditableCombobox , text : * const c_char ) ;
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ extern {
220
220
221
221
pub enum uiEditableCombobox { }
222
222
223
- #[ link( name = "ui" ) ]
223
+ // #[link(name = "ui")]
224
224
extern {
225
225
pub fn uiNewEditableCombobox ( ) -> * mut uiEditableCombobox ;
226
226
pub fn uiEditableComboboxAppend ( c : * mut uiEditableCombobox , text : * const c_char ) ;
You can’t perform that action at this time.
0 commit comments