Ramy Medhat | ec8b8df | 2019-07-17 12:28:40 +0000 | [diff] [blame] | 1 | # |
| 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. |
| 18 | ifneq ($(filter-out false,$(USE_RBE)),) |
| 19 | ifdef RBE_DIR |
| 20 | rbe_dir := $(RBE_DIR) |
| 21 | else |
| 22 | rbe_dir := $(HOME)/rbe |
| 23 | endif |
Kousik Kumar | d463007 | 2020-02-04 18:28:48 -0800 | [diff] [blame^] | 24 | |
| 25 | ifdef RBE_CXX_EXEC_STRATEGY |
| 26 | cxx_rbe_exec_strategy := $(RBE_CXX_EXEC_STRATEGY) |
| 27 | else |
| 28 | cxx_rbe_exec_strategy := "local" |
| 29 | endif |
| 30 | |
| 31 | ifdef RBE_JAVAC_EXEC_STRATEGY |
| 32 | javac_exec_strategy := $(RBE_JAVAC_EXEC_STRATEGY) |
| 33 | else |
| 34 | javac_exec_strategy := "local" |
| 35 | endif |
| 36 | |
| 37 | ifdef RBE_R8_EXEC_STRATEGY |
| 38 | r8_exec_strategy := $(RBE_R8_EXEC_STRATEGY) |
| 39 | else |
| 40 | r8_exec_strategy := "local" |
| 41 | endif |
| 42 | |
| 43 | ifdef RBE_D8_EXEC_STRATEGY |
| 44 | d8_exec_strategy := $(RBE_D8_EXEC_STRATEGY) |
| 45 | else |
| 46 | d8_exec_strategy := "local" |
| 47 | endif |
| 48 | |
Ramy Medhat | a9cc25d | 2020-01-27 14:21:24 -0500 | [diff] [blame] | 49 | RBE_WRAPPER := $(rbe_dir)/rewrapper |
Kousik Kumar | d463007 | 2020-02-04 18:28:48 -0800 | [diff] [blame^] | 50 | RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD --exec_strategy=$(cxx_rbe_exec_strategy) |
Ramy Medhat | ec8b8df | 2019-07-17 12:28:40 +0000 | [diff] [blame] | 51 | |
| 52 | # Append rewrapper to existing *_WRAPPER variables so it's possible to |
| 53 | # use both ccache and rewrapper. |
Ramy Medhat | a9cc25d | 2020-01-27 14:21:24 -0500 | [diff] [blame] | 54 | CC_WRAPPER := $(strip $(CC_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX)) |
| 55 | CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX)) |
| 56 | |
| 57 | ifdef RBE_JAVAC |
Kousik Kumar | d463007 | 2020-02-04 18:28:48 -0800 | [diff] [blame^] | 58 | JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true --exec_strategy=$(javac_exec_strategy)) |
Ramy Medhat | a9cc25d | 2020-01-27 14:21:24 -0500 | [diff] [blame] | 59 | endif |
| 60 | |
| 61 | ifdef RBE_R8 |
Kousik Kumar | d463007 | 2020-02-04 18:28:48 -0800 | [diff] [blame^] | 62 | R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true --exec_strategy=$(r8_exec_strategy)) |
Ramy Medhat | a9cc25d | 2020-01-27 14:21:24 -0500 | [diff] [blame] | 63 | endif |
| 64 | |
| 65 | ifdef RBE_D8 |
Kousik Kumar | d463007 | 2020-02-04 18:28:48 -0800 | [diff] [blame^] | 66 | D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true --exec_strategy=$(d8_exec_strategy)) |
Ramy Medhat | a9cc25d | 2020-01-27 14:21:24 -0500 | [diff] [blame] | 67 | endif |
Ramy Medhat | ec8b8df | 2019-07-17 12:28:40 +0000 | [diff] [blame] | 68 | |
| 69 | rbe_dir := |
| 70 | endif |