Skip to content
Permalink
Browse files
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.


Canonical link: https://commits.webkit.org/194816@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hortont424 committed Oct 21, 2017
1 parent af757d2 commit c581931b5fcc9b07685486bb8760561e52e925e3
Showing with 78 additions and 2 deletions.
  1. +12 −0 ChangeLog
  2. +8 −0 Source/cmake/WebKitCCache.cmake
  3. +1 −0 Source/cmake/WebKitCommon.cmake
  4. +19 −0 Tools/ChangeLog
  5. +11 −1 Tools/Scripts/build-webkit
  6. +1 −1 Tools/ccache/ccache-clang
  7. +26 −0 Tools/ccache/ccache-wrapper
@@ -1,3 +1,15 @@
2017-10-21 Tim Horton <timothy_horton@apple.com>

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 <graouts@apple.com>

[Web Animations] Provide basic timeline and animation interfaces
@@ -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 ()
@@ -52,6 +52,7 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
include(WebKitPackaging)
include(WebKitMacros)
include(WebKitFS)
include(WebKitCCache)
include(WebKitCompilerFlags)
include(WebKitFeatures)

@@ -1,3 +1,22 @@
2017-10-21 Tim Horton <timothy_horton@apple.com>

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 <aakash_jain@apple.com>

Do not run binding tests on multiple EWSes
@@ -66,6 +66,7 @@ my $shouldRunStaticAnalyzer = 0;
my $startTime = time();
my $archs32bit = 0;
my $skipLibraryUpdate = 0;
my $useCCache = -1;

my @features = getFeatureOptionList();

@@ -120,6 +121,8 @@ Usage: $programName [options] [options to pass to build system]
--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 @@ my %options = (
'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 @@ if ($showHelp) {

$ENV{'VERBOSE'} = 1 if $verbose;

if ($useCCache == 1) {
$ENV{'WK_USE_CCACHE'} = "YES";
} elsif ($useCCache == 0) {
$ENV{'WK_USE_CCACHE'} = "NO";
}

checkRequiredSystemConfig();
setConfiguration();

@@ -34,4 +34,4 @@ while [[ $position -le $# ]]; do
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}") "$@"
@@ -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 "$@"

0 comments on commit c581931

Please sign in to comment.