File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,19 @@ if (LIBUNWIND_HAS_NODEFAULTLIBS_FLAG)
29
29
elseif (LIBUNWIND_HAS_GCC_S_LIB)
30
30
list (APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
31
31
endif ()
32
+ if (MINGW)
33
+ # Mingw64 requires quite a few "C" runtime libraries in order for basic
34
+ # programs to link successfully with -nodefaultlibs.
35
+ if (LIBUNWIND_USE_COMPILER_RT)
36
+ set (MINGW_RUNTIME ${LIBUNWIND_BUILTINS_LIBRARY} )
37
+ else ()
38
+ set (MINGW_RUNTIME gcc_s gcc)
39
+ endif ()
40
+ set (MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
41
+ shell32 user32 kernel32 mingw32 ${MINGW_RUNTIME}
42
+ moldname mingwex msvcrt)
43
+ list (APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES} )
44
+ endif ()
32
45
if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
33
46
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all" )
34
47
endif ()
You can’t perform that action at this time.
0 commit comments