File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,12 @@ endif()
169
169
170
170
#
171
171
# Use FetchContent for C++ dependencies that are compiled as part of vLLM's build process.
172
- # Configure it to place files in vllm/.deps, in order to play nicely with sccache.
172
+ # setup.py will override FETCHCONTENT_BASE_DIR to play nicely with sccache.
173
+ # Each dependency that produces build artifacts should override its BINARY_DIR to avoid
174
+ # conflicts between build types. It should instead be set to ${CMAKE_BINARY_DIR}/<dependency>.
173
175
#
174
176
include (FetchContent)
175
- get_filename_component (PROJECT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR} " ABSOLUTE )
176
- file (MAKE_DIRECTORY "${FETCHCONTENT_BASE_DIR} " )
177
- set (FETCHCONTENT_BASE_DIR "${PROJECT_ROOT_DIR} /.deps" )
177
+ file (MAKE_DIRECTORY ${FETCHCONTENT_BASE_DIR} ) # Ensure the directory exists
178
178
message (STATUS "FetchContent base directory: ${FETCHCONTENT_BASE_DIR} " )
179
179
180
180
#
@@ -509,6 +509,8 @@ else()
509
509
GIT_REPOSITORY https://github.com/vllm-project/flash-attention.git
510
510
GIT_TAG 013f0c4fc47e6574060879d9734c1df8c5c273bd
511
511
GIT_PROGRESS TRUE
512
+ # Don't share the vllm-flash-attn build between build types
513
+ BINARY_DIR ${CMAKE_BINARY_DIR} /vllm-flash-attn
512
514
)
513
515
endif ()
514
516
Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ def configure(self, ext: CMakeExtension) -> None:
157
157
# on subsequent calls to python.
158
158
cmake_args += ['-DVLLM_PYTHON_PATH={}' .format (":" .join (sys .path ))]
159
159
160
+ # Override the base directory for FetchContent downloads to $ROOT/.deps
161
+ # This allows sharing dependencies between profiles,
162
+ # and plays more nicely with sccache.
163
+ # To override this, set the FETCHCONTENT_BASE_DIR environment variable.
164
+ fc_base_dir = os .path .join (ROOT_DIR , ".deps" )
165
+ fc_base_dir = os .environ .get ("FETCHCONTENT_BASE_DIR" , fc_base_dir )
166
+ cmake_args += ['-DFETCHCONTENT_BASE_DIR={}' .format (fc_base_dir )]
167
+
160
168
#
161
169
# Setup parallelism and build tool
162
170
#
You can’t perform that action at this time.
0 commit comments