[libcxx] r299144 - Try to fix the libcxx build with mingw64

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 17:34:05 PDT 2017


Author: rnk
Date: Thu Mar 30 19:34:05 2017
New Revision: 299144

URL: http://llvm.org/viewvc/llvm-project?rev=299144&view=rev
Log:
Try to fix the libcxx build with mingw64

Summary:
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.

Reviewers: mati865, EricWF

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D31518

Modified:
    libcxx/trunk/cmake/config-ix.cmake

Modified: libcxx/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=299144&r1=299143&r2=299144&view=diff
==============================================================================
--- libcxx/trunk/cmake/config-ix.cmake (original)
+++ libcxx/trunk/cmake/config-ix.cmake Thu Mar 30 19:34:05 2017
@@ -35,6 +35,11 @@ if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
   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 ()




More information about the cfe-commits mailing list