File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -160,19 +160,9 @@ check_cxx_source_compiles(
160160 HAVE_DECL_STRERROR_S)
161161
162162
163- # Search for clang_rt.builtins library.
163+ # Search for clang_rt.builtins library. Need in addition to msvcrt.
164164if (WIN32 )
165- execute_process (
166- COMMAND "${CMAKE_CXX_COMPILER} " "-print-libgcc-file-name" "-rtlib=compiler-rt"
167- RESULT_VARIABLE CXX_COMPILER_PRINT_LIBGCC_PATH_FAILURE
168- OUTPUT_VARIABLE CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT
169- ERROR_QUIET
170- )
171- if (NOT CXX_COMPILER_PRINT_LIBGCC_PATH_FAILURE AND CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT)
172- string (STRIP "${CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT} " FLANG_RT_LIBCALL)
173- else ()
174- set (FLANG_RT_LIBCALL "" )
175- endif ()
165+ find_compiler_rt_library(builtins FLANG_RT_BUILTINS_LIBRARY)
176166endif ()
177167
178168
Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ function (add_flangrt_library name)
125125 # functions in some cases like 128-bit integer math (__udivti3, __modti3,
126126 # __fixsfti, __floattidf, ...) that msvc does not support. We are injecting a
127127 # dependency to Compiler-RT's builtin library where these are implemented.
128- if (MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" ) AND FLANG_RT_LIBCALL )
129- target_compile_options (${name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "--dependent-lib=${FLANG_RT_LIBCALL } " )
128+ if (MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" ) AND FLANG_RT_BUILTINS_LIBRARY )
129+ target_compile_options (${name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX,C>:-Xclang>$<$<COMPILE_LANGUAGE:Fortran>:-Xflang>" "--dependent-lib=${FLANG_RT_BUILTINS_LIBRARY } " )
130130 endif ()
131131
132132 # Non-GTest unittests depend on LLVMSupport
You can’t perform that action at this time.
0 commit comments