[Build] Fix FetchContent multiple build issue (#9596)

Signed-off-by: luka <luka@neuralmagic.com>
This commit is contained in:
Luka Govedič
2024-10-23 00:43:07 -04:00
committed by GitHub
parent 831540cf04
commit 51c24c9736
2 changed files with 14 additions and 4 deletions

View File

@@ -157,6 +157,14 @@ class cmake_build_ext(build_ext):
# on subsequent calls to python.
cmake_args += ['-DVLLM_PYTHON_PATH={}'.format(":".join(sys.path))]
# Override the base directory for FetchContent downloads to $ROOT/.deps
# This allows sharing dependencies between profiles,
# and plays more nicely with sccache.
# To override this, set the FETCHCONTENT_BASE_DIR environment variable.
fc_base_dir = os.path.join(ROOT_DIR, ".deps")
fc_base_dir = os.environ.get("FETCHCONTENT_BASE_DIR", fc_base_dir)
cmake_args += ['-DFETCHCONTENT_BASE_DIR={}'.format(fc_base_dir)]
#
# Setup parallelism and build tool
#