summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-03-31 00:34:05 +0000
committerReid Kleckner <rnk@google.com>2017-03-31 00:34:05 +0000
commitc5d4ad6bd643cc7c34779b1c863b64dc01e1dd30 (patch)
tree2a9893f550612df40ee1243dd1c8494b96c8b937 /libcxx/cmake
parent8377febb370c1301eaa4431ab050523e97ed444b (diff)
downloadbcm5719-llvm-c5d4ad6bd643cc7c34779b1c863b64dc01e1dd30.tar.gz
bcm5719-llvm-c5d4ad6bd643cc7c34779b1c863b64dc01e1dd30.zip
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 llvm-svn: 299144
Diffstat (limited to 'libcxx/cmake')
-rw-r--r--libcxx/cmake/config-ix.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake
index 4f13b787ae3..ed9d3e8e89b 100644
--- a/libcxx/cmake/config-ix.cmake
+++ b/libcxx/cmake/config-ix.cmake
@@ -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 ()
OpenPOWER on IntegriCloud