Actually yes, you can. There are 2 steps in recruiting:
1. Find people who want to apply 2. Have them go through a hiring process to select which one you make an offer
You can seek diversity in step 1 and be completely merit-based on step 2.
If your step 1. is mostly ask your (currently overwhelming white male) engineers for referrals, of course you'll get a bunch of white dudes. You have to find other channels.
Diversity shouldn't be excluding people who happen to be part of the current majority, but enlarging your pool of candidates.
Also, the whole idea of hiring "merit-based" is a bit naive because you're not hiring people on a single objective metric. There are a bunch of metrics, most of them judged subjectively: technical abilities, adaptability, communication abilities, person easy to work with, and the list goes on.
So while Google definitely screwed up by trying to take the easy path to a more diverse workforce, you can seek diversity without excluding white dudes.