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(
160
160
HAVE_DECL_STRERROR_S )
161
161
162
162
163
- # Search for clang_rt.builtins library.
163
+ # Search for clang_rt.builtins library. Need in addition to msvcrt.
164
164
if (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 )
176
166
endif ()
177
167
178
168
Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ function (add_flangrt_library name)
125
125
# functions in some cases like 128-bit integer math (__udivti3, __modti3,
126
126
# __fixsfti, __floattidf, ...) that msvc does not support. We are injecting a
127
127
# 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 } " )
130
130
endif ()
131
131
132
132
# Non-GTest unittests depend on LLVMSupport
You can’t perform that action at this time.
0 commit comments