@@ -116,7 +116,7 @@ fn translate_shader(
116
116
let mut build = cc:: Build :: new ( ) ;
117
117
build. no_default_flags ( true ) ;
118
118
if let Ok ( tool) = build. try_get_compiler ( ) {
119
- if is_like_msvc ( & tool ) {
119
+ if tool . is_like_msvc ( ) {
120
120
build. flag ( "/EP" ) ;
121
121
if tool. path ( ) . to_str ( ) . is_some_and ( |p| p. contains ( "clang" ) ) {
122
122
build. flag ( "/clang:-undef" ) ;
@@ -185,7 +185,7 @@ fn main() {
185
185
build. cpp ( true ) ;
186
186
187
187
if let Ok ( tool) = build. try_get_compiler ( ) {
188
- if is_like_msvc ( & tool ) {
188
+ if tool . is_like_msvc ( ) {
189
189
build
190
190
. flag ( "/std:c++17" )
191
191
. flag ( "/EHs-" )
@@ -212,7 +212,7 @@ fn main() {
212
212
// instructions makes things easier on the processor and in places where it matters we can
213
213
// probably explicitly use reciprocal instructions and avoid the refinement step.
214
214
// Also, allow checks for non-finite values which fast-math may disable.
215
- if is_like_msvc ( & tool ) {
215
+ if tool . is_like_msvc ( ) {
216
216
build
217
217
. flag ( "/fp:fast" )
218
218
. flag ( "-Xclang" )
@@ -252,20 +252,3 @@ impl Drop for EnvVarGuard {
252
252
}
253
253
}
254
254
}
255
-
256
- fn is_like_msvc ( tool : & cc:: Tool ) -> bool {
257
- tool. is_like_msvc ( ) || {
258
- // `mozilla-central` does this funky thing where it replaces `clang-cl.exe` with
259
- // `clang.exe --driver-mode=cl`, which isn't considered by `Tool::is_like_msvc`, _but_
260
- // it forces the CLI to adhere to a `cl`-like interface and reject naively `clang`-like
261
- // arguments.
262
- //
263
- // See also `config/static-checking-config.mk`:
264
- // <https://searchfox.org/mozilla-central/rev/dd8b64a6198ff599a5eb2ca096845ebd6997457f/config/static-checking-config.mk>
265
- let starts_with_driver_mode_cl = |arg : & std:: ffi:: OsStr | {
266
- arg. to_str ( )
267
- . is_some_and ( |a| a. starts_with ( "--driver-mode=cl" ) )
268
- } ;
269
- tool. is_like_clang ( ) && tool. to_command ( ) . get_args ( ) . any ( starts_with_driver_mode_cl)
270
- }
271
- }
0 commit comments