1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 03:48:02 +08:00

FASTBuild: don't set default cache path

Leave only 2 option to set cache path:
1. CMake variable
2. Environment variable
Update docs to reflect the changes.
This commit is contained in:
Eduard Voronkin
2025-09-07 21:20:31 -07:00
committed by Eduard Voronkin
parent 563e11b6fd
commit f77628e0af
3 changed files with 18 additions and 8 deletions

View File

@@ -27,6 +27,19 @@ This writes a FASTBuild configuration file named ``fbuild.bff`` into
These IDE files can be generated by building ``xcode`` or ``solution`` targets
and will build using FASTBuild as the backend.
Caching
-------
To enable FASTBuild caching, set the cache path using the
:variable:`CMAKE_FASTBUILD_CACHE_PATH` variable or the
``FASTBUILD_CACHE_PATH`` environment variable.
Then build with the ``-cache`` flag:
.. code-block:: console
cmake --build <path-to-build> -- -cache
Configuration Variables
-----------------------

View File

@@ -1,9 +1,10 @@
CMAKE_FASTBUILD_CACHE_PATH
---------------------------
--------------------------
Specifies the directory for the FASTBuild artifact cache.
Specifies the directory for the FASTBuild artifact cache in the generated file.
Defaults to :variable:`CMAKE_BINARY_DIR` ``/fbuild.cache`` if not set.
If not set, FASTBuild will use the ``FASTBUILD_CACHE_PATH`` environment
variable at build time.
See the `FASTBuild caching documentation <https://www.fastbuild.org/docs/features/caching.html>`_
for more information.

View File

@@ -538,12 +538,8 @@ void cmGlobalFastbuildGenerator::WriteSettings()
auto val = this->GetSafeGlobalSetting(FASTBUILD_CACHE_PATH);
if (!val.empty()) {
cacheDir = std::move(val);
} else {
// Default value.
cacheDir =
this->GetCMakeInstance()->GetHomeOutputDirectory() + "/fbuild.cache";
cmSystemTools::ConvertToOutputSlashes(cacheDir);
}
cmSystemTools::ConvertToOutputSlashes(cacheDir);
WriteDivider();
*this->BuildFileStream << "// Settings\n\n";