Skip to content

Commit

Permalink
ansible,win: add ccache (#4016)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanStojanovic authored Feb 10, 2025
1 parent e9dcd9f commit 9321081
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/roles/visual-studio/files/ccache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max_size = 10 GB
20 changes: 20 additions & 0 deletions ansible/roles/visual-studio/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,23 @@
- name: build clcache
win_shell: '$env:PYTHONPATH = "C:\clcache"; py -3 -m PyInstaller -y pyinstaller/clcache_main.py'
args: { chdir: 'C:\clcache' }

# Install ccache and enable using it with Visual Studio
- block:
- name: install ccache
win_chocolatey:
name: ccache
pinned: yes
version: "4.10.2"
- name: make ccache directory
win_command: 'mkdir C:\ccache'
- name: copy ccache to ccache directory as cl.exe
win_command: 'cp C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.10.2-windows-x86_64\ccache.exe C:\ccache\cl.exe'
- name: make directory for caching
win_command: 'mkdir C:\ccache\cache'
- name: set caching directory enviroment variable
win_command: 'setx CCACHE_DIR C:\ccache\cache /M'
- name: copy ccache.conf to ccache directory
win_copy:
src: ../files/ccache.conf
dest: C:\ccache\cache\ccache.conf

0 comments on commit 9321081

Please sign in to comment.