@@ -21,9 +21,24 @@ fn main() {
21
21
let target = env:: var ( "TARGET" ) . expect ( "TARGET was not set" ) ;
22
22
let cfg = & mut gcc:: Config :: new ( ) ;
23
23
24
+ let mut profile_sources = vec ! [ "GCDAProfiling.c" ,
25
+ "InstrProfiling.c" ,
26
+ "InstrProfilingBuffer.c" ,
27
+ "InstrProfilingFile.c" ,
28
+ "InstrProfilingMerge.c" ,
29
+ "InstrProfilingMergeFile.c" ,
30
+ "InstrProfilingPlatformDarwin.c" ,
31
+ "InstrProfilingPlatformLinux.c" ,
32
+ "InstrProfilingPlatformOther.c" ,
33
+ "InstrProfilingRuntime.cc" ,
34
+ "InstrProfilingUtil.c" ,
35
+ "InstrProfilingValue.c" ,
36
+ "InstrProfilingWriter.c" ] ;
37
+
24
38
if target. contains ( "msvc" ) {
25
39
// Don't pull in extra libraries on MSVC
26
40
cfg. flag ( "/Zl" ) ;
41
+ profile_sources. push ( "WindowsMMap.c" ) ;
27
42
} else {
28
43
// Turn off various features of gcc and such, mostly copying
29
44
// compiler-rt's build system already
@@ -34,20 +49,6 @@ fn main() {
34
49
cfg. define ( "VISIBILITY_HIDDEN" , None ) ;
35
50
}
36
51
37
- let profile_sources = & [ "GCDAProfiling.c" ,
38
- "InstrProfiling.c" ,
39
- "InstrProfilingBuffer.c" ,
40
- "InstrProfilingFile.c" ,
41
- "InstrProfilingMerge.c" ,
42
- "InstrProfilingMergeFile.c" ,
43
- "InstrProfilingPlatformDarwin.c" ,
44
- "InstrProfilingPlatformLinux.c" ,
45
- "InstrProfilingPlatformOther.c" ,
46
- "InstrProfilingRuntime.cc" ,
47
- "InstrProfilingUtil.c" ,
48
- "InstrProfilingValue.c" ,
49
- "InstrProfilingWriter.c" ] ;
50
-
51
52
for src in profile_sources {
52
53
cfg. file ( Path :: new ( "../compiler-rt/lib/profile" ) . join ( src) ) ;
53
54
}
0 commit comments