They have codes that address seismic forces. Link is from a UN agency:
Turkey: New building code for earthquake resilience
As far as codes are concerned, it is important to know how well they are enforced. Even if these earthquake codes were rigorously enforced, a looming problem for any country with substantial seismic zones is the existing building stock. For seismically active areas, it is important to know how many buildings were built before seismic codes were introduced, and whether there are incentives or regulations that require upgrading structural systems to resist seismic forces. In older historic cities, there are many structures that predate the building codes, and most countries cannot simply replace or upgrade such buildings on a large scale.
In many California cities, there are large numbers of buildings that were built before seismic codes were introduced, and others that meet older codes that are inadequate for protecting the occupants. Economically, there just isn't enough money to replace all of these buildings, and many owners can't afford significant structural upgrades and the work it entails. I'm aware of some public buildings that are vacant, because they can't meet current codes without upgrades that are beyond the means of the entities that own them.
Also, the magnitude of this earthquake is going to push structures to the limit.