summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:10 +0000
commitb276b1db48faa7328575ab722fe3bc340623f025 (patch)
tree9e4ba424f754c3f05e409ae647fa358031d97617 /cmake
parentd1bd27794dfbc317e27d1ec63b338115cbf194ba (diff)
downloadsrc-test2-b276b1db48faa7328575ab722fe3bc340623f025.tar.gz
src-test2-b276b1db48faa7328575ab722fe3bc340623f025.zip
Notes
Diffstat (limited to 'cmake')
-rw-r--r--cmake/config-ix.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index c425c31ea095..730ee7e164a6 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -41,7 +41,15 @@ if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
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)
+ if (LIBCXX_USE_COMPILER_RT)
+ set(MINGW_RUNTIME ${LIBCXX_BUILTINS_LIBRARY})
+ else ()
+ set(MINGW_RUNTIME gcc_s gcc)
+ endif()
+ set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
+ shell32 user32 kernel32 mingw32 ${MINGW_RUNTIME}
+ moldname mingwex msvcrt)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
endif()
if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")