Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 93d0384

Browse files
committed
Rust: fix MSVC-built lib pulling in other lib files
1 parent 5c8f1b6 commit 93d0384

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/builtins/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,18 @@ else ()
361361
endif ()
362362
endforeach ()
363363

364+
# Rust: don't insert a reference to MSVCRT.lib/etc
365+
if (MSVC)
366+
set(_cflags -Zl)
367+
else ()
368+
set(_cflags -std=c99)
369+
endif ()
370+
364371
add_compiler_rt_runtime(clang_rt.builtins
365372
STATIC
366373
ARCHS ${arch}
367374
SOURCES ${${arch}_SOURCES}
368-
CFLAGS "-std=c99"
375+
CFLAGS ${_cflags}
369376
PARENT_TARGET builtins)
370377
endif ()
371378
endforeach ()

lib/builtins/int_math.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#if defined(_MSC_VER) && !defined(__clang__)
2929
#include <math.h>
3030
#include <stdlib.h>
31-
#include <ymath.h>
31+
// Rust: need to upstream this
32+
// don't include ymath.h, it's not needed + pulls in the C++ stdlib for some reason
33+
// #include <ymath.h>
3234
#endif
3335

3436
#if defined(_MSC_VER) && !defined(__clang__)

0 commit comments

Comments
 (0)