[macos] fix build on macOS (Xcode 12.4 and earlier)

The change introduced by [1] broke build on my macOS laptop
with Xcode 12.4.

This patch addresses the issue: as it turned out, starting with
Xcode 12.5 the location of the libc++ headers changed, so it's necessary
to use different approaches for different Xcode versions (for details,
see the comment added in src/kudu/codegen/CMakeLists.txt).

I verified the new approach works on my Intel-based laptop:
  * macOS Catalina 10.15.7 with Xcode 11.7, 12.4
  * macOS BigSur 11.6.8 with Xcode 11.7, 12.4, 12.5, 13.2.1.

[1] https://github.com/apache/kudu/commit/543e128d473f8f7836e605bba8cd6512fa918550

Change-Id: Ib47f2d04cb87a3fc9c9a8b8c10c17d4f502c47c0
Reviewed-on: http://gerrit.cloudera.org:8080/18820
Tested-by: Alexey Serbin <alexey@apache.org>
Reviewed-by: Attila Bukor <abukor@apache.org>
Tested-by: Attila Bukor <abukor@apache.org>
1 file changed