Index: llvm/lib/CMakeLists.txt =================================================================== --- llvm/lib/CMakeLists.txt +++ llvm/lib/CMakeLists.txt @@ -24,4 +24,9 @@ add_subdirectory(Passes) add_subdirectory(ToolDrivers) add_subdirectory(XRay) -add_subdirectory(Testing) + +if (LLVM_INCLUDE_TESTS AND LLVM_INCLUDE_UTILS) + # Testing library depends on gtest, which is only included if + # both of these variables are ON. + add_subdirectory(Testing) +endif() \ No newline at end of file Index: llvm/lib/Testing/Support/CMakeLists.txt =================================================================== --- llvm/lib/Testing/Support/CMakeLists.txt +++ llvm/lib/Testing/Support/CMakeLists.txt @@ -9,4 +9,4 @@ include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include) -target_link_libraries(LLVMTestingSupport PRIVATE gtest) \ No newline at end of file +target_link_libraries(LLVMTestingSupport INTERFACE gtest) \ No newline at end of file