The partition of irreversible heating between ions and electrons in compressively driven (but subsonic) collisionless turbulence is investigated by means of nonlinear hybrid gyrokinetic simulations. We derive a prescription for the ion-to-electron heating ratio $Q_rmi/Q_rme$ as a function of the compressive-to-Alfvenic driving power ratio $P_compr/P_AW$, of the ratio of ion thermal pressure to magnetic pressure $beta_rmi$, and of the ratio of ion-to-electron background temperatures $T_rmi/T_rme$. It is shown that $Q_rmi/Q_rme$ is an increasing function of $P_compr/P_AW$. When the compressive driving is sufficiently large, $Q_rmi/Q_rme$ approaches $simeq P_compr/P_AW$. This indicates that, in turbulence with large compressive fluctuations, the partition of heating is decided at the injection scales, rather than at kinetic scales. Analysis of phase-space spectra shows that the energy transfer from inertial-range compressive fluctuations to sub-Larmor-scale kinetic Alfven waves is absent for both low and high $beta_rmi$, meaning that the compressive driving is directly connected to the ion entropy fluctuations, which are converted into ion thermal energy. This result suggests that preferential electron heating is a very special case requiring low $beta_rmi$ and no, or weak, compressive driving. Our heating prescription has wide-ranging applications, including to the solar wind and to hot accretion disks such as M87 and Sgr A*.