Skip to content

Commit bad9b93

Browse files
author
George Adams
committed
add ccache for macos
1 parent c7010d7 commit bad9b93

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ansible/roles/baselayout/tasks/main.yml

+14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
- "{{ packages[os|stripversion]|default('[]') }}"
7474
- "{{ common_packages|default('[]') }}"
7575

76+
- name: Check whether /etc/paths contains "/usr/localopt/ccache/libexec" (macos)
77+
when: os|startswith("macos")
78+
command: grep -Fxq "/usr/localopt/ccache/libexec" /etc/paths
79+
register: ccache_mac
80+
check_mode: no
81+
ignore_errors: yes
82+
changed_when: no
83+
84+
- name: add ccache to the path (macos)
85+
when: ccache_mac.rc == 1
86+
lineinfile: dest=/etc/paths
87+
insertbefore=BOF
88+
line='/usr/localopt/ccache/libexec'
89+
7690
- name: update package alternatives
7791
when: os == "ubuntu1404"
7892
alternatives: link=/usr/bin/{{ gcc }} name={{ gcc }} path=/usr/bin/{{ gcc }}-4.9

ansible/roles/baselayout/vars/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ packages: {
9191
macos: [
9292
'curl',
9393
'python2',
94+
'ccache',
9495
],
9596

9697
smartos14: [

0 commit comments

Comments
 (0)