blob: 6a923664b7e65e41522ae87c8d6576902e6a7aa7 [file] [log] [blame]
Ramy Medhatec8b8df2019-07-17 12:28:40 +00001#
2# Copyright (C) 2019 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Notice: this works only with Google's RBE service.
18ifneq ($(filter-out false,$(USE_RBE)),)
19 ifdef RBE_DIR
20 rbe_dir := $(RBE_DIR)
21 else
22 rbe_dir := $(HOME)/rbe
23 endif
Ramy Medhata9cc25d2020-01-27 14:21:24 -050024 RBE_WRAPPER := $(rbe_dir)/rewrapper
25 RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD
Ramy Medhatec8b8df2019-07-17 12:28:40 +000026
27 # Append rewrapper to existing *_WRAPPER variables so it's possible to
28 # use both ccache and rewrapper.
Ramy Medhata9cc25d2020-01-27 14:21:24 -050029 CC_WRAPPER := $(strip $(CC_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
30 CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
31
32 ifdef RBE_JAVAC
33 JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true)
34 endif
35
36 ifdef RBE_R8
37 R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true)
38 endif
39
40 ifdef RBE_D8
41 D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true)
42 endif
Ramy Medhatec8b8df2019-07-17 12:28:40 +000043
44 rbe_dir :=
45endif