Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible,win: add ccache #4016

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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