I don’t believe that CMake supports this today. CMake would need a genex to look up per-architecture bits and then also know to add -arch flags in front to hide from other arches on “fat” compilation rules. You can file a feature request, but it doesn’t sound trivial to resolve to me.
One thing that would work today would be to make another directory where the contents of those headers detects the target processor and chains off to the real directory based on that (basically moving the directory selection off to the compiler).
Ah, thanks for the suggestion. I was wondering if I had to make two separate targets and manually lipo the binaries together. Doing a shim-header is simpler.
I’ll log a file request for per-arch config. Might find that I need it in other cases going forward now that we need to deal with arm64 on mac.