From f59ea3f561b9eb8e6331b3c3b1962d09ecf4367e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 16 May 2019 16:51:59 -0700 Subject: [PATCH] getdeps: add support for using ccache in cmake builds Summary: if we find ccache in the path, then we instruct cmake to use it as the compiler launcher. Reviewed By: pkaush Differential Revision: D15375441 fbshipit-source-id: 602fe54742a5ec07b0533bd2cf63cb905b051e85 --- build/fbcode_builder/getdeps/builder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/fbcode_builder/getdeps/builder.py b/build/fbcode_builder/getdeps/builder.py index 88167d7c6..b886defa3 100644 --- a/build/fbcode_builder/getdeps/builder.py +++ b/build/fbcode_builder/getdeps/builder.py @@ -229,6 +229,9 @@ class CMakeBuilder(BuilderBase): "CMAKE_BUILD_TYPE": "RelWithDebInfo", } env = self._compute_env(install_dirs) + ccache = path_search(env, "ccache") + if ccache: + defines["CMAKE_CXX_COMPILER_LAUNCHER"] = ccache if self.build_opts.is_darwin(): # Try to persuade cmake to set the rpath to match the lib # dirs of the dependencies. This isn't automatic, and to