[PATCH] D31518: Try to fix the libcxx build with mingw64
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 30 17:28:17 PDT 2017
rnk created this revision.
Herald added a subscriber: mgorny.
mingw64 has lots of default libs that libc++ and its test programs
should link against.
With this patch, cmake now runs successfully with GCC on Windows.
https://reviews.llvm.org/D31518
Files:
libcxx/cmake/config-ix.cmake
Index: libcxx/cmake/config-ix.cmake
===================================================================
--- libcxx/cmake/config-ix.cmake
+++ libcxx/cmake/config-ix.cmake
@@ -35,6 +35,11 @@
elseif (LIBCXX_HAS_GCC_S_LIB)
list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
endif ()
+ if (MINGW)
+ # Mingw64 requires quite a few "C" runtime libraries in order for basic
+ # programs to link successfully with -nodefaultlibs.
+ list(APPEND CMAKE_REQUIRED_LIBRARIES mingw32 gcc gcc_eh mingwex msvcrt gcc)
+ endif()
if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
endif ()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31518.93568.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170331/728fee4b/attachment.bin>
More information about the cfe-commits
mailing list