ccache support

This commit is contained in:
Ari Lazier 2016-11-10 23:55:26 -08:00
parent 81402f890b
commit 08ffc3bf15
7 changed files with 31 additions and 11 deletions

View File

@ -717,6 +717,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../../scripts/ccache-clang";
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -764,6 +765,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../../scripts/ccache-clang";
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;

View File

@ -247,6 +247,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../scripts/ccache-clang.sh";
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
@ -296,6 +297,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../scripts/ccache-clang.sh";
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";

11
scripts/ccache-clang++.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
export CCACHE_MAXSIZE=10G
export CCACHE_CPP2=true
export CCACHE_HARDLINK=true
export CCACHE_SLOPPINESS=file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches
exec /usr/local/bin/ccache /usr/bin/clang++ "$@"
else
exec clang++ "$@"
fi

11
scripts/ccache-clang.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
export CCACHE_MAXSIZE=10G
export CCACHE_CPP2=true
export CCACHE_HARDLINK=true
export CCACHE_SLOPPINESS=file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches
exec /usr/local/bin/ccache /usr/bin/clang "$@"
else
exec clang "$@"
fi

View File

@ -122,19 +122,13 @@ case "$TARGET" in
npm run jsdoc npm run jsdoc
;; ;;
"realmjs") "realmjs")
#HACK
brew install yarn
pushd src pushd src
xctest RealmJS xctest RealmJS
;; ;;
"react-tests") "react-tests")
pushd tests/react-test-app pushd tests/react-test-app
if [ -f ../../target=node_modules/react_tests_node_modules.zip ]; then npm install
unzip -q ../../target=node_modules/react_tests_node_modules.zip
fi
yarn install
open_chrome open_chrome
start_packager start_packager
@ -144,10 +138,6 @@ case "$TARGET" in
"react-example") "react-example")
pushd examples/ReactExample pushd examples/ReactExample
if [ -f ../../target=node_modules/react_example_node_modules.zip ]; then
unzip -q ../../target=node_modules/react_example_node_modules.zip
fi
npm install npm install
open_chrome open_chrome
start_packager start_packager

View File

@ -995,6 +995,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../scripts/ccache-clang.sh";
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -1056,6 +1057,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../scripts/ccache-clang.sh";
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;

View File

@ -807,6 +807,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../../scripts/ccache-clang.sh";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -859,6 +860,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CC = "$(SRCROOT)/../../../scripts/ccache-clang.sh";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;