浏览代码

Mention ccache in developer docs

Alexander Wilms 2 年之前
父节点
当前提交
b36767904a
共有 3 个文件被更改,包括 19 次插入5 次删除
  1. 8 3
      docs/developers/Building_Linux.md
  2. 8 1
      docs/developers/Building_Windows.md
  3. 3 1
      docs/developers/Building_macOS.md

+ 8 - 3
docs/developers/Building_Linux.md

@@ -19,13 +19,15 @@ To compile, the following packages (and their development counterparts) are need
 -   Boost C++ libraries v1.48+: program-options, filesystem, system, thread, locale
 -   Recommended, if you want to build launcher or map editor: Qt 5, widget and network modules
 -   Recommended, FFmpeg libraries, if you want to watch in-game videos: libavformat and libswscale. Their name could be libavformat-devel and libswscale-devel, or ffmpeg-libs-devel or similar names. 
--   Optional, if you want to build scripting modules: LuaJIT
+-   Optional:
+    - if you want to build scripting modules: LuaJIT
+    - to speed up recompilation: Ccache
 
 ## On Debian-based systems (e.g. Ubuntu)
 
 For Ubuntu and Debian you need to install this list of packages:
 
-`sudo apt-get install cmake g++ clang libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-locale-dev qtbase5-dev libtbb-dev libluajit-5.1-dev qttools5-dev ninja-build`
+`sudo apt-get install cmake g++ clang libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-locale-dev qtbase5-dev libtbb-dev libluajit-5.1-dev qttools5-dev ninja-build ccache`
 
 Alternatively if you have VCMI installed from repository or PPA you can use:
 
@@ -33,7 +35,7 @@ Alternatively if you have VCMI installed from repository or PPA you can use:
 
 ## On RPM-based distributions (e.g. Fedora)
 
-`sudo yum install cmake gcc-c++ SDL2-devel SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs qt5-qtbase-devel tbb-devel luajit-devel fuzzylite-devel`
+`sudo yum install cmake gcc-c++ SDL2-devel SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs qt5-qtbase-devel tbb-devel luajit-devel fuzzylite-devel ccache`
 
 NOTE: `fuzzylite-devel` package is no longer available in recent version of Fedora, for example Fedora 38. It's not a blocker because VCMI bundles fuzzylite lib in its source code.
 
@@ -73,6 +75,9 @@ cmake ../vcmi
 
 **Notice**: The ../vcmi/ is not a typo, it will place makefile scripts into the build dir as the build dir is your working dir when calling CMake.
 
+## To use ccache:
+`cmake ../vcmi -DCMAKE_COMPILER_LAUNCHER=ccache`
+
 ## Trigger build
 
 `cmake --build . -- -j2`

+ 8 - 1
docs/developers/Building_Windows.md

@@ -10,7 +10,10 @@ Windows builds can be made in more than one way and with more than one tool. Thi
 - Git or git GUI, for example, SourceTree [download link](http://www.sourcetreeapp.com/download)
 - CMake [download link](https://cmake.org/download/). During install after accepting license agreement make sure to check "Add CMake to the system PATH for all users".
 - To unpack pre-build Vcpkg: [7-zip](http://www.7-zip.org/download.html)
-- Optionally, to create installer: [NSIS](http://nsis.sourceforge.net/Main_Page)
+- To speed up recompilation: [CCache](https://github.com/ccache/ccache/releases)
+- Optional:
+    - To create installer: [NSIS](http://nsis.sourceforge.net/Main_Page)
+
 
 ## Choose an installation directory
 
@@ -75,6 +78,10 @@ From command line use:
 
 For the list of the packages used you can also consult [vcmi-deps-windows readme](https://github.com/vcmi/vcmi-deps-windows) in case this article gets outdated a bit.
 
+### CCache
+
+Extract `ccache` to a folder of your choosing, add the folder to the `PATH` environment variable and log out and back in.
+
 # Build VCMI
 
 #### From GIT GUI

+ 3 - 1
docs/developers/Building_macOS.md

@@ -7,7 +7,9 @@
     - Xcode IDE: <https://developer.apple.com/xcode/>
     - (not tested) other C++ compilers, e.g. gcc/clang from [Homebrew](https://brew.sh/)
 2. CMake: `brew install --cask cmake` or get from <https://cmake.org/download/>
-3. (optional) Ninja: `brew install ninja` or get from <https://github.com/ninja-build/ninja/releases>
+3. CCache to speed up recompilation: `brew install ccache`
+4. Optional:
+    * Ninja: `brew install ninja` or get it from <https://github.com/ninja-build/ninja/releases>
 
 # Obtaining source code