From 2f6023b567c77bd6b665c62a36809d3b8d6acf06 Mon Sep 17 00:00:00 2001 From: Tyler Michael Smith Date: Sat, 28 Sep 2024 23:13:01 -0400 Subject: [PATCH] [Build/CI] Set FETCHCONTENT_BASE_DIR to one location for better caching (#8930) --- .gitignore | 1 + CMakeLists.txt | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index abeaf0a82e303..5367ece834890 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +/.deps/ # PyInstaller # Usually these files are written by a python script from a template diff --git a/CMakeLists.txt b/CMakeLists.txt index b2fa72d4775c4..e531a410ec8c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,16 @@ if(NVCC_THREADS AND VLLM_GPU_LANG STREQUAL "CUDA") list(APPEND VLLM_GPU_FLAGS "--threads=${NVCC_THREADS}") endif() + +# +# Use FetchContent for C++ dependencies that are compiled as part of vLLM's build process. +# Configure it to place files in vllm/.deps, in order to play nicely with sccache. +# include(FetchContent) +get_filename_component(PROJECT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) +file(MAKE_DIRECTORY "${FETCHCONTENT_BASE_DIR}") +set(FETCHCONTENT_BASE_DIR "${PROJECT_ROOT_DIR}/.deps") +message(STATUS "FetchContent base directory: ${FETCHCONTENT_BASE_DIR}") # # Define other extension targets