Try harder to support gtests with non-standard build config
am: 5515310c7e

Change-Id: Iec28e20e7506f3f7bdb4ebb6fec620cefbb3c269