-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always pass a -x argument to gcc/clang
First and foremost, to generically convey the type of compilation, we normalize the file extension, and will use that information to feed the right -x argument to the preprocessor and compiler. When the compiler command sccache is invoked with already contains a -x argument, we set the normalized file extension accordingly, such that it matches what the caller wants, rather than what the source file extension says. On the preprocessor end, we then always pass one of `-x c`, `-x c++`, `-x objective-c` or `-x objective-c++` according to the normalized file extension. On the compiler end, we always pass one of `-x cpp-output`, `-x c++-cpp-output`, `-x objective-c-cpp-output` or `-x objective-c++-cpp-output` accordingly. Note that we used to pass `-x objc-cpp-output` to gcc, but that's a deprecated form that it now warns about. The new form has been available since at least gcc 4.3, so is fine to use. And because a same source compiled as C or C++ will yield different object code, include the normalized extension when computing the hashed value. Fixes #163.
- Loading branch information
Showing
2 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters