I found myself needing to compile a library today with M1 support. Googling a little, I found CMAKE_OSX_ARCHITECTURES. This worked great for most of our code!
But then I came across our libjpeg_turbo dependency - which uses different files depending on the architecture. This is for SIMD support. We have a couple others like this as well.
I googled around quite a bit but couldn’t really find a solution for this. The best I found is to use ifdef guards to only compile in the correct arch and just include all the files. I would rather not do that if I don’t have to, but that would definitely work.
Does anyone know if I’m missing something here?