Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info

Apple platforms macOS, iOS, tvOS, and watchOS can all share the same
compiler information.  Rename `Darwin-*` modules to `Apple-*` and load
them all through `CMAKE_EFFECTIVE_SYSTEM_NAME`.  This saves duplication
of 4 * 21 compiler information modules.

Issue: #17870
This commit is contained in:
Gregor Jasny
2018-04-18 07:41:42 -04:00
committed by Brad King
parent 84f9f63fcc
commit e95b3fd9bb
35 changed files with 47 additions and 38 deletions
@@ -11,6 +11,11 @@
#
# It is useful to share the same aforementioned configuration files and
# avoids duplicating them in case of tightly related platforms.
#
# An example are the platforms supported by Xcode (macOS, iOS, tvOS,
# and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is
# set to Apple which results in using
# Platfom/Apple-AppleClang-CXX.cmake for the Apple C++ compiler.
set(CMAKE_EFFECTIVE_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
include(Platform/${CMAKE_SYSTEM_NAME}-Initialize OPTIONAL)