From 7f1ea55094095f1ea274c87239f4dccb4c1a04dc Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Tue, 11 Mar 2025 10:02:13 -0700 Subject: [PATCH] Update [ghstack-poisoned] --- build/Test.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/Test.cmake b/build/Test.cmake index dbe590d610b..8538e7b7d28 100644 --- a/build/Test.cmake +++ b/build/Test.cmake @@ -35,8 +35,14 @@ function(et_cxx_test target_name) set(multi_arg_names SOURCES EXTRA_LIBS) cmake_parse_arguments(ET_CXX_TEST "" "" "${multi_arg_names}" ${ARGN}) - add_executable(${target_name} ${ET_CXX_TEST_SOURCES} ${EXECUTORCH_ROOT}/runtime/core/exec_aten/testing_util/tensor_util.cpp) - find_package(GTest) + add_executable( + ${target_name} + ${ET_CXX_TEST_SOURCES} + ${EXECUTORCH_ROOT}/runtime/core/exec_aten/testing_util/tensor_util.cpp + ) + if(NOT TARGET GTest::gtest) + find_package(GTest) + endif() # Includes gtest, gmock, executorch by default target_link_libraries( ${target_name} GTest::gtest GTest::gtest_main GTest::gmock executorch