Skip to content

Commit 900ba55

Browse files
committed
Compile WindowsMMap too on MSVC
1 parent ce56daf commit 900ba55

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/libprofiler_builtins/build.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,24 @@ fn main() {
2121
let target = env::var("TARGET").expect("TARGET was not set");
2222
let cfg = &mut gcc::Config::new();
2323

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+
2438
if target.contains("msvc") {
2539
// Don't pull in extra libraries on MSVC
2640
cfg.flag("/Zl");
41+
profile_sources.push("WindowsMMap.c");
2742
} else {
2843
// Turn off various features of gcc and such, mostly copying
2944
// compiler-rt's build system already
@@ -34,20 +49,6 @@ fn main() {
3449
cfg.define("VISIBILITY_HIDDEN", None);
3550
}
3651

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-
5152
for src in profile_sources {
5253
cfg.file(Path::new("../compiler-rt/lib/profile").join(src));
5354
}

0 commit comments

Comments
 (0)