Title: [223818] trunk
Revision
223818
Author
[email protected]
Date
2017-10-21 14:42:51 -0700 (Sat, 21 Oct 2017)

Log Message

Turn on ccache for Mac cmake builds by default
https://bugs.webkit.org/show_bug.cgi?id=177059

Reviewed by Sam Weinig.

.:

* Source/cmake/WebKitCCache.cmake: Added.
* Source/cmake/WebKitCommon.cmake:
Turn on ccache for Mac CMake builds (Makefile and Ninja generators only)
if it's installed, making use of CMake's ability to wrap the compiler invocation.

Tools:

* ccache/ccache-clang:
* ccache/ccache-wrapper: Added.
Add a pass-through ccache wrapper to be used with CMake, in addition
to the existing faux-clang wrappers.

* Scripts/build-webkit:
Add --use-ccache and --no-use-ccache option, which will define
WK_USE_CCACHE to YES or NO, respectively, which the underlying
build systems respect. We do not define WK_USE_CCACHE if the option
is not specified, because the underlying build systems have different
default values.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (223817 => 223818)


--- trunk/ChangeLog	2017-10-21 19:23:07 UTC (rev 223817)
+++ trunk/ChangeLog	2017-10-21 21:42:51 UTC (rev 223818)
@@ -1,3 +1,15 @@
+2017-10-21  Tim Horton  <[email protected]>
+
+        Turn on ccache for Mac cmake builds by default
+        https://bugs.webkit.org/show_bug.cgi?id=177059
+
+        Reviewed by Sam Weinig.
+
+        * Source/cmake/WebKitCCache.cmake: Added.
+        * Source/cmake/WebKitCommon.cmake:
+        Turn on ccache for Mac CMake builds (Makefile and Ninja generators only)
+        if it's installed, making use of CMake's ability to wrap the compiler invocation.
+
 2017-10-20  Antoine Quint  <[email protected]>
 
         [Web Animations] Provide basic timeline and animation interfaces

Added: trunk/Source/cmake/WebKitCCache.cmake (0 => 223818)


--- trunk/Source/cmake/WebKitCCache.cmake	                        (rev 0)
+++ trunk/Source/cmake/WebKitCCache.cmake	2017-10-21 21:42:51 UTC (rev 223818)
@@ -0,0 +1,8 @@
+# Enable ccache by default for the Mac port, if installed.
+# Setting WK_USE_CCACHE=NO in your environment will disable it.
+if (PORT STREQUAL "Mac" AND NOT "$ENV{WK_USE_CCACHE}" STREQUAL "NO")
+    find_program(CCACHE_FOUND ccache)
+    if (CCACHE_FOUND)
+        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CMAKE_SOURCE_DIR}/Tools/ccache/ccache-wrapper)
+    endif ()
+endif ()

Modified: trunk/Source/cmake/WebKitCommon.cmake (223817 => 223818)


--- trunk/Source/cmake/WebKitCommon.cmake	2017-10-21 19:23:07 UTC (rev 223817)
+++ trunk/Source/cmake/WebKitCommon.cmake	2017-10-21 21:42:51 UTC (rev 223818)
@@ -52,6 +52,7 @@
     include(WebKitPackaging)
     include(WebKitMacros)
     include(WebKitFS)
+    include(WebKitCCache)
     include(WebKitCompilerFlags)
     include(WebKitFeatures)
 

Modified: trunk/Tools/ChangeLog (223817 => 223818)


--- trunk/Tools/ChangeLog	2017-10-21 19:23:07 UTC (rev 223817)
+++ trunk/Tools/ChangeLog	2017-10-21 21:42:51 UTC (rev 223818)
@@ -1,3 +1,22 @@
+2017-10-21  Tim Horton  <[email protected]>
+
+        Turn on ccache for Mac cmake builds by default
+        https://bugs.webkit.org/show_bug.cgi?id=177059
+
+        Reviewed by Sam Weinig.
+
+        * ccache/ccache-clang:
+        * ccache/ccache-wrapper: Added.
+        Add a pass-through ccache wrapper to be used with CMake, in addition
+        to the existing faux-clang wrappers.
+
+        * Scripts/build-webkit:
+        Add --use-ccache and --no-use-ccache option, which will define
+        WK_USE_CCACHE to YES or NO, respectively, which the underlying
+        build systems respect. We do not define WK_USE_CCACHE if the option
+        is not specified, because the underlying build systems have different
+        default values.
+
 2017-10-20  Aakash Jain  <[email protected]>
 
         Do not run binding tests on multiple EWSes

Modified: trunk/Tools/Scripts/build-webkit (223817 => 223818)


--- trunk/Tools/Scripts/build-webkit	2017-10-21 19:23:07 UTC (rev 223817)
+++ trunk/Tools/Scripts/build-webkit	2017-10-21 21:42:51 UTC (rev 223818)
@@ -66,6 +66,7 @@
 my $startTime = time();
 my $archs32bit = 0;
 my $skipLibraryUpdate = 0;
+my $useCCache = -1;
 
 my @features = getFeatureOptionList();
 
@@ -120,6 +121,8 @@
 
   --skip-library-update             Skip the check to see if windows libraries are up to date
 
+  --[no-]use-ccache                 Enable (or disable) CCache, if available
+
 EOF
 
 my %options = (
@@ -136,7 +139,8 @@
     'coverage' => \$coverageSupport,
     'analyze' => \$shouldRunStaticAnalyzer,
     'default-cmake-features' => \$defaultCMakeFeatures,
-    'skip-library-update' => \$skipLibraryUpdate
+    'skip-library-update' => \$skipLibraryUpdate,
+    'use-ccache!' => \$useCCache,
 );
 
 # Build usage text and options list from features
@@ -155,6 +159,12 @@
 
 $ENV{'VERBOSE'} = 1 if $verbose;
 
+if ($useCCache == 1) {
+    $ENV{'WK_USE_CCACHE'} = "YES";
+} elsif ($useCCache == 0) {
+    $ENV{'WK_USE_CCACHE'} = "NO";
+}
+
 checkRequiredSystemConfig();
 setConfiguration();
 

Modified: trunk/Tools/ccache/ccache-clang (223817 => 223818)


--- trunk/Tools/ccache/ccache-clang	2017-10-21 19:23:07 UTC (rev 223817)
+++ trunk/Tools/ccache/ccache-clang	2017-10-21 21:42:51 UTC (rev 223818)
@@ -34,4 +34,4 @@
     esac
     position=$(($position + 1))
 done
-CCACHE_SLOPPINESS="pch_defines,time_macros" ccache $(xcrun -f -sdk "$sdk" "${_XCRUN_TOOL:-clang}") "$@"
+$(dirname "$0")/ccache-wrapper $(xcrun -f -sdk "$sdk" "${_XCRUN_TOOL:-clang}") "$@"

Copied: trunk/Tools/ccache/ccache-wrapper (from rev 223813, trunk/Tools/ccache/ccache-clang) (0 => 223818)


--- trunk/Tools/ccache/ccache-wrapper	                        (rev 0)
+++ trunk/Tools/ccache/ccache-wrapper	2017-10-21 21:42:51 UTC (rev 223818)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# Copyright (C) 2017 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+CCACHE_SLOPPINESS="pch_defines,time_macros" ccache "$@"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to