[Xcode] Add an experimental setting to build with ccache
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jul 2017 18:36:06 +0000 (18:36 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jul 2017 18:36:06 +0000 (18:36 +0000)
commitc4e24d21f10a023ee02204e3493d84e8e27ba77e
tree0ff08ed9156771ed9304b94b0501fcf88e47ac77
parent61e62b5115dfde4f72924754adedac12314e67f6
[Xcode] Add an experimental setting to build with ccache
https://bugs.webkit.org/show_bug.cgi?id=173875

Reviewed by Tim Horton.

Source/bmalloc:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/JavaScriptCore:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/ThirdParty/ANGLE:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/ThirdParty/libwebrtc:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/WebCore:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/WebCore/PAL:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/WebKit/mac:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/WebKit2:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Source/WTF:

* Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

Tools:

On systems that already have ccache(1) installed, this patch adds experimental support for
it to Xcode builds. It can be enabled with the WK_USE_CCACHE build setting.

When ccache is enabled, CC is overridden to invoke Tools/ccache/ccache-clang. This script
finds the "-isysroot" argument to determine the active SDK, uses xcrun(1) and the SDK to
find the toolchain from which to run clang, and then invokes ccache with the required
arguments.

ccache is invoked with CCACHE_SLOPPINESS="pch_defines,time_macros", which is required for
precompiled headers to work properly [1].

LDPLUSPLUS is overridden to invoke Tools/ccache/ccache-clang++. It behaves the same as
ccache-clang, except it tells ccache to execute clang++ instead of clang. This is important
during linking.

[1] https://ccache.samba.org/manual.html#_precompiled_headers

* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
* MiniBrowser/Configurations/DebugRelease.xcconfig: Ditto.
* MobileMiniBrowser/Configurations/DebugRelease.xcconfig: Ditto.
* TestWebKitAPI/Configurations/DebugRelease.xcconfig: Ditto.
* WebKitTestRunner/Configurations/DebugRelease.xcconfig: Ditto.
* ccache/README.md: Added.
* ccache/ccache-clang: Added.
* ccache/ccache-clang++: Added.
* ccache/ccache.xcconfig: Added. Overrides CC and LDPLUSPLUS when WK_USE_CACHE=YES.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/DebugRelease.xcconfig
Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig
Source/WTF/ChangeLog
Source/WTF/Configurations/DebugRelease.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/DebugRelease.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/DebugRelease.xcconfig
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/DebugRelease.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/DebugRelease.xcconfig
Source/bmalloc/ChangeLog
Source/bmalloc/Configurations/DebugRelease.xcconfig
Tools/ChangeLog
Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
Tools/MiniBrowser/Configurations/DebugRelease.xcconfig
Tools/MobileMiniBrowser/Configurations/DebugRelease.xcconfig
Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig
Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
Tools/ccache/README.md [new file with mode: 0644]
Tools/ccache/ccache-clang [new file with mode: 0755]
Tools/ccache/ccache-clang++ [new file with mode: 0755]
Tools/ccache/ccache.xcconfig [new file with mode: 0644]