summaryrefslogtreecommitdiff
path: root/Modules/CMakeSystemSpecificInitialize.cmake
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2018-04-01 22:49:59 +0200
committerBrad King <brad.king@kitware.com>2018-04-18 07:41:42 -0400
commite95b3fd9bbca94cb5f217847031c9c8f393aee78 (patch)
tree792206201111cbb237a9888fd97f9d42b31c9913 /Modules/CMakeSystemSpecificInitialize.cmake
parent84f9f63fccdadb9b8a0bdb3260a0c7a3f71cb251 (diff)
downloadcmake-e95b3fd9bbca94cb5f217847031c9c8f393aee78.tar.gz
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
Diffstat (limited to 'Modules/CMakeSystemSpecificInitialize.cmake')
-rw-r--r--Modules/CMakeSystemSpecificInitialize.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake
index 629f226c13..de4d7f5728 100644
--- a/Modules/CMakeSystemSpecificInitialize.cmake
+++ b/Modules/CMakeSystemSpecificInitialize.cmake
@@ -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)