Skip to content

Compiler abstraction #956

Open
Open

Description

@jrosdahl

Ccache started with support for GCC and compilers that were "similar enough". During the years, more support for GCC-like compilers like Clang was added with well-placed if/else statements. Then NVCC support was added with even more ifs and elses. I've accepted the current state since both Clang and NVCC support come with reasonably extensive test suites so that it will hopefully be easy to refactor compiler support in the future without breaking stuff.

However, since there are wishes for supporting compilers that don't behave like GCC at all (e.g. MSVC in #431/#506 and Tasking in #841/#942) there is a desperate need of better code structure - the code base simply can't handle more accidental complexity. There should be an API that captures compiler specifics such as how to process arguments, how to preprocess code, how to retrieve included files (for the direct mode), etc. Compiler-specific behavior should then be put in implementations of that API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: improvement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions