CMake install operation very slow for VS2017 32-bit build
Reproduction steps:
Reproduced on Windows 10 Pro v1809:
- Visual Studio 2017 (I used Community Edition)
- CMake (I used 3.13.3, both x86 and x64, CMake must be added to the PATH env var)
- Conan (https://conan.io/downloads.html)
-
Clone this repo: https://gitlab.com/ssrobins/sfml-examples/
-
Open a terminal, cd to the repo, and run: build_windows64.bat This generates a 64-bit VS2017 project and does the build, install, and packaging.
Install/packaging step is quick, as expected since the total size of files being copied over is only 22 MB. My CI system does the whole build, install, and package process in 2 minutes, 16 seconds: https://gitlab.com/ssrobins/sfml-examples/-/jobs/151715635
- Open a terminal, cd to the repo, and run: build_windows.bat This is the same as above except a 32-bit VS2017 project is generated.
The 'Install component' for each target takes much longer. My CI system takes 9 minutes, 13 seconds to do the build, install, and packaging: https://gitlab.com/ssrobins/sfml-examples/-/jobs/151714703
macOS and linux 64-bit builds took less than a minute and a half: https://gitlab.com/ssrobins/sfml-examples/-/jobs/151714552 https://gitlab.com/ssrobins/sfml-examples/-/jobs/151714553
The problem can be reproduced with the install command of a single target:
- cd build_windows\01_Tetris
- cmake.exe --trace -DBUILD_TYPE=Release -P cmake_install.cmake
The trace shows that it's primarily spending time on this command: file(INSTALL DESTINATION ${CMAKE_INSTALL_PREFIX}/01_Tetris TYPE EXECUTABLE FILES D:/Code/sfml-examples/build_windows/01_Tetris/Release/01_Tetris.exe )
The command takes about a second for the 64-bit build and around 9 seconds for the 32-bit build.
This problem has forced me to comment out the install step on several targets to keep builds fast.