  A measurement of the time-integrated $CP$ asymmetry in the Cabibbo-suppressed
decay $D^0\rightarrow K^-K^+$ is performed using pp collision data,
corresponding to an integrated luminosity of 3fb$^{-1}$, collected with the
LHCb detector at centre-of-mass energies of 7 and 8 TeV. The flavour of the
charm meson at production is determined from the charge of the pion in
$D^{*+}\rightarrow D^0 \pi^+$ and $D^{*-}\rightarrow \bar{D^0} \pi^-$ decays.
The time-integrated $CP$ asymmetry $A_{CP}(K^-K^+)$ is obtained assuming
negligible $CP$ violation in charm mixing and in Cabibbo-favoured
$D^0\rightarrow K^-\pi^+$, $D^+\rightarrow K^-\pi^+\pi^+$ and $D^+\rightarrow
\bar{K^0}\pi^+$ decays used as calibration channels. It is found to be
$A_{CP}(K^-K^+)=(0.14\pm0.15(stat)\pm0.10(syst))\%$. A combination of this
result with previous LHCb measurements yields
$A_{CP}(K^-K^+)=(0.04\pm0.12(stat)\pm0.10(syst))\%$,
$A_{CP}(\pi^-\pi^+)=(0.07\pm0.14(stat)\pm0.11(syst))\%$. These are the most
precise measurements from a single experiment. The result for $A_{CP}(K^-K^+)$
is the most precise determination of a time-integrated $CP$ asymmetry in the
charm sector to date, and neither measurement shows evidence of CP asymmetry.
