Having run CX5's since 2012, I think the build quality is pretty good. I've never had any issues with squeaks, rattles, things dropping off, etc. I do think the paint is a bit "weak", but I don't think Mazda are any different to any other make in that respect, it more down to the ban on older type solvent based paints. The issues I've had have been with the engine (2012 model with the cheese camshaft) and with the infotainment system (2015 model).
Having said that, I went to the Volvo XC40 launch last week. First impression is that it's a lot better than the Mazda...
Alan