Modules: Introduce CMAKE_EFFECTIVE_SYSTEM_NAME to lookup compiler info

Create a `CMAKE_EFFECTIVE_SYSTEM_NAME` variable to use for looking
up compiler information modules instead of using `CMAKE_SYSTEM_NAME`
directly.  This will allow multiple platforms to share the same set
of compiler information modules without spelling out all of them.

Issue: #17870
This commit is contained in:
Gregor Jasny
2018-04-01 22:49:59 +02:00
committed by Brad King
parent 9fa0f2eb56
commit 84f9f63fcc
8 changed files with 28 additions and 20 deletions
@@ -5,6 +5,14 @@
# This file is included by cmGlobalGenerator::EnableLanguage.
# It is included before the compiler has been determined.
# The CMAKE_EFFECTIVE_SYSTEM_NAME is used to load compiler and compiler
# wrapper configuration files. By default it equals to CMAKE_SYSTEM_NAME
# but could be overridden in the ${CMAKE_SYSTEM_NAME}-Initialize files.
#
# It is useful to share the same aforementioned configuration files and
# avoids duplicating them in case of tightly related platforms.
set(CMAKE_EFFECTIVE_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
include(Platform/${CMAKE_SYSTEM_NAME}-Initialize OPTIONAL)
set(CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED 1)