Skip to content

Commit

Permalink
Mk/bsd.ccache.mk: Add CCACHE_ENABLED variable for ports' convenience
Browse files Browse the repository at this point in the history
Some projects do some special handling when the ccache program is present.
This causes problems because ports framework has its own ccache settings
and mere presence of ccache program doesn't mean that ccache is enabled.
The new CCACHE_ENABLED variable can be used to tell projects if ccache
is really enabled.

PR:		266310
Approved by:	tcberner@ (as portmgr)
  • Loading branch information
yurivict committed Sep 12, 2022
1 parent 49bbc37 commit 679b9e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mk/bsd.ccache.mk
Expand Up @@ -11,6 +11,7 @@
# default.
#
# Port use (users should not modify these):
# - CCACHE_ENABLED - tells the port if ccache is enabled.
# - CCACHE_BIN - path to the ccache binary. Intended to be prefixed before CC.
# - CCACHE_WRAPPER_PATH - path to directory containing compiler symlinks back
# to ccache. For example, gcc5 -> ccache. Intended
Expand Down Expand Up @@ -42,11 +43,18 @@ _CCACHEMKINCLUDED= yes
NO_CCACHE= t
. endif

. if defined(WITH_CCACHE_BUILD)
CCACHE_ENABLED= yes
. else
CCACHE_ENABLED= no
. endif

# HOME is always set to ${WRKDIR} now. Try to use /root/.ccache as default.
. if defined(WITH_CCACHE_BUILD) && !defined(CCACHE_DIR)
. if defined(USER) && ${USER} == root
CCACHE_DIR= /root/.ccache
. else
CCACHE_ENABLED= no
NO_CCACHE= yes
WARNING+= WITH_CCACHE_BUILD support disabled, please set CCACHE_DIR.
. endif
Expand Down

0 comments on commit 679b9e2

Please sign in to comment.