From 8760db154aec99c70cb487d99aead838212d4986 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Mon, 4 Dec 2023 13:41:38 -0800 Subject: [PATCH] Skip find_package(Python3) when not building tests #4424 claims this saves several seconds of build time Closes #4424 PiperOrigin-RevId: 587827426 Change-Id: I207779a6539f9af16a39d6b40887770dc930b74f --- googletest/cmake/internal_utils.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 21887b2e..580ac1cb 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -247,7 +247,9 @@ function(cxx_executable name dir libs) ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN}) endfunction() -find_package(Python3) +if(gtest_build_tests) + find_package(Python3) +endif() # cxx_test_with_flags(name cxx_flags libs srcs...) #