diff options
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/ccache.bbclass | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass index 960902065c..59e1022678 100644 --- a/meta/classes/ccache.bbclass +++ b/meta/classes/ccache.bbclass | |||
| @@ -1,4 +1,14 @@ | |||
| 1 | CCACHE = "${@bb.utils.which(d.getVar('PATH'), 'ccache') and 'ccache '}" | 1 | # |
| 2 | # Usage: | ||
| 3 | # - Enable ccache | ||
| 4 | # Add the following line to a conffile such as conf/local.conf: | ||
| 5 | # INHERIT += "ccache" | ||
| 6 | # | ||
| 7 | # - Disable ccache for a recipe | ||
| 8 | # Add the following line to the recipe if it can't be built with ccache: | ||
| 9 | # CCACHE_DISABLE = '1' | ||
| 10 | # | ||
| 11 | |||
| 2 | export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}" | 12 | export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}" |
| 3 | 13 | ||
| 4 | # We need to stop ccache considering the current directory or the | 14 | # We need to stop ccache considering the current directory or the |
| @@ -7,5 +17,14 @@ export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}" | |||
| 7 | # ${PV} or ${PR} change. | 17 | # ${PV} or ${PR} change. |
| 8 | export CCACHE_NOHASHDIR ?= "1" | 18 | export CCACHE_NOHASHDIR ?= "1" |
| 9 | 19 | ||
| 10 | DEPENDS_append_class-target = " ccache-native" | 20 | python() { |
| 11 | DEPENDS[vardepvalueexclude] = " ccache-native" | 21 | """ |
| 22 | Enable ccache for the recipe | ||
| 23 | """ | ||
| 24 | pn = d.getVar('PN') | ||
| 25 | # quilt-native doesn't need ccache since no c files | ||
| 26 | if not (pn in ('ccache-native', 'quilt-native') or | ||
| 27 | bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))): | ||
| 28 | d.appendVar('DEPENDS', ' ccache-native') | ||
| 29 | d.setVar('CCACHE', 'ccache ') | ||
| 30 | } | ||
