cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

Add `compiler.is_clang_cl()` helper.

Open snailspeed3 opened this issue 2 years ago • 0 comments

Motivating example:

The following boilerplate is required to enable compilation with SSE3 intrinsics.

let compiler = build.get_compiler();
let is_clang_cl = compiler.path().ends_with("clang-cl.exe") || compiler.path().ends_with("clang-cl");
if compiler.is_like_gnu() || compiler.is_like_clang() || is_clang_cl {
    #[cfg(target_arch = "x86_64")]
    build.flag("-mssse3");
}

cc-rs should provide and maintain a is_clang_cl helper to make this process more robust and convenient.

snailspeed3 avatar Aug 16 '23 11:08 snailspeed3