diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-03 00:40:17 +0300 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-03 00:40:17 +0300 |
commit | 58729cd53ea259cfaf84ec468083f9b239457d23 (patch) | |
tree | e2fca046325bde1eba54241a262209f7177be6d5 /libcxx/lib | |
parent | 2d2ed1cc472a87a14a0f955ae716ebb63de15016 (diff) |
build: tweak macros for Windows build
Move the windows specific macro definitions for compiling c++ into the
target. Add a number of newer options that are necessary to properly
build libc++ for windows. This ensures that we do not accidentally
autolink msvcprt (Microsoft's C++ runtime library), do not define linker
pragmas which are msvcprt specific, and do not accidentally encode the
incorrect version of the msvc compatibility version.
llvm-svn: 290837
Diffstat (limited to 'libcxx/lib')
-rw-r--r-- | libcxx/lib/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index 53f93aed9b91..f37ac68ebc26 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -161,6 +161,28 @@ split_list(LIBCXX_LINK_FLAGS) # Add a object library that contains the compiled source files. add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) +if(WIN32 AND NOT MINGW) + target_compile_definitions(cxx_objects + PRIVATE + # Ignore the -MSC_VER mismatch, as we may build + # with a different compatibility version. + _ALLOW_MSC_VER_MISMATCH + # Don't check the msvcprt iterator debug levels + # as we will define the iterator types; libc++ + # uses a different macro to identify the debug + # level. + _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH + # We are building the c++ runtime, don't pull in + # msvcprt. + _CRTBLD + # Don't warn on the use of "deprecated" + # "insecure" functions which are standards + # specified. + _CRT_SECURE_NO_WARNINGS + # Use the ISO conforming behaviour for conversion + # in printf, scanf. + _CRT_STDIO_ISO_WIDE_SPECIFIERS) +endif() set_target_properties(cxx_objects PROPERTIES |