summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeSystemSpecificInitialize.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-06 19:36:54 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-07 11:02:20 (GMT)
commit1373373823ccaf8378a19a95685337061d79d5b1 (patch)
tree882877cbe65068d3df0eadbd75a74fdd52a0d87c /Modules/CMakeSystemSpecificInitialize.cmake
parent1d916bf3d2dad26682ed73c6cbed88babe28af7b (diff)
downloadCMake-1373373823ccaf8378a19a95685337061d79d5b1.zip
CMake-1373373823ccaf8378a19a95685337061d79d5b1.tar.gz
CMake-1373373823ccaf8378a19a95685337061d79d5b1.tar.bz2
enable_language: Establish target platform identification variables earlier
Set target platform identification variables like `APPLE` and `LINUX` as soon as the target system is identified. This makes them available during toolchain and binutils selection. Fixes: #23333
Diffstat (limited to 'Modules/CMakeSystemSpecificInitialize.cmake')
-rw-r--r--Modules/CMakeSystemSpecificInitialize.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake
index 21bcd40..e87d868 100644
--- a/Modules/CMakeSystemSpecificInitialize.cmake
+++ b/Modules/CMakeSystemSpecificInitialize.cmake
@@ -5,6 +5,19 @@
# This file is included by cmGlobalGenerator::EnableLanguage.
# It is included before the compiler has been determined.
+# before cmake 2.6 these variables were set in cmMakefile.cxx. This is still
+# done to keep scripts and custom language and compiler modules working.
+# But they are reset here and set again in the platform files for the target
+# platform, so they can be used for testing the target platform instead
+# of testing the host platform.
+unset(APPLE)
+unset(UNIX)
+unset(CYGWIN)
+unset(MSYS)
+unset(WIN32)
+unset(BSD)
+unset(LINUX)
+
# 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.