Skip to content

Handle -Xclang for clang-cl #262

@luser

Description

@luser

We added basic support for clang-cl recently, but we don't handle-Xclang, which can be used to pass options down to the clang frontend (vs. the clang-cl frontend which parses MSVC options). We use this in Firefox builds to pass down GCC-style dependency options, like:
-Xclang -MP -Xclang -dependency-file -Xclang .deps/lz4.obj.pp -Xclang -MT -Xclang lz4.obj

Currently sccache refuses to cache these compiles because it thinks the arguments to -Xclang that do not start with a dash are input source files, and it will not cache a compile with multiple source files. At the very least we need it to understand that -Xclang takes an argument so that it parses the commandline correctly.

A more thorough followup would be to correctly detect clang-cl as clang-cl, and parse its commandlines with MSVC arguments but also accumulate -Xclang arguments into a separate list and then parse them with the clang argument parser, which might be a bit hairy. Otherwise we won't properly cache compiles like the example above, where we're instructing clang-cl to output a dependency file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions