From 1373373823ccaf8378a19a95685337061d79d5b1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 6 Jun 2023 15:36:54 -0400 Subject: 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 --- Modules/CMakeSystemSpecificInformation.cmake | 13 ------------- Modules/CMakeSystemSpecificInitialize.cmake | 13 +++++++++++++ Modules/Platform/AIX-Initialize.cmake | 1 + Modules/Platform/Android-Initialize.cmake | 5 +++++ Modules/Platform/Android.cmake | 5 ----- Modules/Platform/BSDOS-Initialize.cmake | 1 + Modules/Platform/BeOS-Initialize.cmake | 2 ++ Modules/Platform/BeOS.cmake | 2 -- Modules/Platform/BlueGeneL-Initialize.cmake | 1 + Modules/Platform/BlueGeneP-base.cmake | 5 ----- Modules/Platform/BlueGeneP-dynamic-Initialize.cmake | 1 + Modules/Platform/BlueGeneP-static-Initialize.cmake | 1 + Modules/Platform/BlueGeneQ-base.cmake | 5 ----- Modules/Platform/BlueGeneQ-dynamic-Initialize.cmake | 1 + Modules/Platform/BlueGeneQ-static-Initialize.cmake | 1 + Modules/Platform/CYGWIN-Initialize.cmake | 2 ++ Modules/Platform/CYGWIN.cmake | 2 -- Modules/Platform/Catamount-Initialize.cmake | 1 + Modules/Platform/CrayLinuxEnvironment-Initialize.cmake | 4 ++++ Modules/Platform/CrayLinuxEnvironment.cmake | 2 -- Modules/Platform/DOS-Initialize.cmake | 1 + Modules/Platform/DOS.cmake | 2 -- Modules/Platform/Darwin-Initialize.cmake | 3 +++ Modules/Platform/Darwin.cmake | 2 -- Modules/Platform/DragonFly-Initialize.cmake | 2 ++ Modules/Platform/DragonFly.cmake | 1 - Modules/Platform/FreeBSD-Initialize.cmake | 2 ++ Modules/Platform/FreeBSD.cmake | 1 - Modules/Platform/Fuchsia-Initialize.cmake | 1 + Modules/Platform/Fuchsia.cmake | 2 -- Modules/Platform/GNU-Initialize.cmake | 2 ++ Modules/Platform/HP-UX-Initialize.cmake | 1 + Modules/Platform/Haiku-Initialize.cmake | 2 ++ Modules/Platform/Haiku.cmake | 3 --- Modules/Platform/Linux-Initialize.cmake | 3 +++ Modules/Platform/Linux.cmake | 1 - Modules/Platform/MP-RAS-Initialize.cmake | 1 + Modules/Platform/MSYS-Initialize.cmake | 2 ++ Modules/Platform/MSYS.cmake | 1 - Modules/Platform/Midipix-Initialize.cmake | 1 + Modules/Platform/NetBSD-Initialize.cmake | 2 ++ Modules/Platform/NetBSD.cmake | 1 - Modules/Platform/OSF1-Initialize.cmake | 1 + Modules/Platform/OpenBSD-Initialize.cmake | 2 ++ Modules/Platform/OpenBSD.cmake | 1 - Modules/Platform/OpenVMS-Initialize.cmake | 1 + Modules/Platform/QNX-Initialize.cmake | 1 + Modules/Platform/QNX.cmake | 2 -- Modules/Platform/RISCos-Initialize.cmake | 1 + Modules/Platform/SCO_SV-Initialize.cmake | 1 + Modules/Platform/SINIX-Initialize.cmake | 1 + Modules/Platform/SerenityOS-Initialize.cmake | 2 ++ Modules/Platform/SerenityOS.cmake | 3 --- Modules/Platform/SunOS-Initialize.cmake | 1 + Modules/Platform/Tru64-Initialize.cmake | 1 + Modules/Platform/ULTRIX-Initialize.cmake | 1 + Modules/Platform/UNIX_SV-Initialize.cmake | 1 + Modules/Platform/UnixPaths.cmake | 3 +++ Modules/Platform/UnixWare-Initialize.cmake | 1 + Modules/Platform/Windows-Initialize.cmake | 1 + Modules/Platform/Windows.cmake | 10 ---------- Modules/Platform/WindowsCE-Initialize.cmake | 2 ++ Modules/Platform/WindowsPhone-Initialize.cmake | 2 ++ Modules/Platform/WindowsStore-Initialize.cmake | 2 ++ Modules/Platform/Xenix-Initialize.cmake | 1 + Modules/Platform/eCos-Initialize.cmake | 1 + Modules/Platform/syllable-Initialize.cmake | 1 + 67 files changed, 85 insertions(+), 64 deletions(-) create mode 100644 Modules/Platform/AIX-Initialize.cmake create mode 100644 Modules/Platform/BSDOS-Initialize.cmake create mode 100644 Modules/Platform/BeOS-Initialize.cmake create mode 100644 Modules/Platform/BlueGeneL-Initialize.cmake create mode 100644 Modules/Platform/BlueGeneP-dynamic-Initialize.cmake create mode 100644 Modules/Platform/BlueGeneP-static-Initialize.cmake create mode 100644 Modules/Platform/BlueGeneQ-dynamic-Initialize.cmake create mode 100644 Modules/Platform/BlueGeneQ-static-Initialize.cmake create mode 100644 Modules/Platform/CYGWIN-Initialize.cmake create mode 100644 Modules/Platform/Catamount-Initialize.cmake create mode 100644 Modules/Platform/CrayLinuxEnvironment-Initialize.cmake create mode 100644 Modules/Platform/DOS-Initialize.cmake create mode 100644 Modules/Platform/DragonFly-Initialize.cmake create mode 100644 Modules/Platform/FreeBSD-Initialize.cmake create mode 100644 Modules/Platform/Fuchsia-Initialize.cmake create mode 100644 Modules/Platform/HP-UX-Initialize.cmake create mode 100644 Modules/Platform/Haiku-Initialize.cmake create mode 100644 Modules/Platform/MP-RAS-Initialize.cmake create mode 100644 Modules/Platform/MSYS-Initialize.cmake create mode 100644 Modules/Platform/Midipix-Initialize.cmake create mode 100644 Modules/Platform/NetBSD-Initialize.cmake create mode 100644 Modules/Platform/OSF1-Initialize.cmake create mode 100644 Modules/Platform/OpenBSD-Initialize.cmake create mode 100644 Modules/Platform/OpenVMS-Initialize.cmake create mode 100644 Modules/Platform/RISCos-Initialize.cmake create mode 100644 Modules/Platform/SCO_SV-Initialize.cmake create mode 100644 Modules/Platform/SINIX-Initialize.cmake create mode 100644 Modules/Platform/SerenityOS-Initialize.cmake create mode 100644 Modules/Platform/SunOS-Initialize.cmake create mode 100644 Modules/Platform/Tru64-Initialize.cmake create mode 100644 Modules/Platform/ULTRIX-Initialize.cmake create mode 100644 Modules/Platform/UNIX_SV-Initialize.cmake create mode 100644 Modules/Platform/UnixWare-Initialize.cmake create mode 100644 Modules/Platform/Windows-Initialize.cmake create mode 100644 Modules/Platform/WindowsCE-Initialize.cmake create mode 100644 Modules/Platform/WindowsPhone-Initialize.cmake create mode 100644 Modules/Platform/WindowsStore-Initialize.cmake create mode 100644 Modules/Platform/Xenix-Initialize.cmake create mode 100644 Modules/Platform/eCos-Initialize.cmake create mode 100644 Modules/Platform/syllable-Initialize.cmake diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index b5dc8d3..70bcf5c 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -6,19 +6,6 @@ # It is included after the compiler has been determined, so # we know things like the compiler name and if the compiler is gnu. -# 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. -set(APPLE ) -set(UNIX ) -set(CYGWIN ) -set(MSYS ) -set(WIN32 ) -set(BSD ) -set(LINUX ) - function(_cmake_record_install_prefix ) set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE) set(_CMAKE_SYSTEM_PREFIX_PATH_STAGING_PREFIX_VALUE "${CMAKE_STAGING_PREFIX}" PARENT_SCOPE) 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. diff --git a/Modules/Platform/AIX-Initialize.cmake b/Modules/Platform/AIX-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/AIX-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index 63bc949..2a2f6e2 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -23,6 +23,11 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1) return() endif() +include(Platform/Linux-Initialize) +unset(LINUX) + +set(ANDROID 1) + set(CMAKE_BUILD_TYPE_INIT "RelWithDebInfo") if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED) diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake index 0530988..f490f0e 100644 --- a/Modules/Platform/Android.cmake +++ b/Modules/Platform/Android.cmake @@ -4,11 +4,6 @@ if(CMAKE_ANDROID_NDK) include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android.cmake OPTIONAL) endif() -include(Platform/Linux) -unset(LINUX) - -set(ANDROID 1) - # Natively compiling on an Android host doesn't need these flags to be reset. if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") return() diff --git a/Modules/Platform/BSDOS-Initialize.cmake b/Modules/Platform/BSDOS-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BSDOS-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/BeOS-Initialize.cmake b/Modules/Platform/BeOS-Initialize.cmake new file mode 100644 index 0000000..ccdac64 --- /dev/null +++ b/Modules/Platform/BeOS-Initialize.cmake @@ -0,0 +1,2 @@ +set(BEOS 1) +set(UNIX 1) diff --git a/Modules/Platform/BeOS.cmake b/Modules/Platform/BeOS.cmake index ef811bd..e8573b9 100644 --- a/Modules/Platform/BeOS.cmake +++ b/Modules/Platform/BeOS.cmake @@ -1,5 +1,3 @@ -set(BEOS 1) - set(CMAKE_DL_LIBS root be) set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") diff --git a/Modules/Platform/BlueGeneL-Initialize.cmake b/Modules/Platform/BlueGeneL-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BlueGeneL-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake index 7095dd8..3c06215 100644 --- a/Modules/Platform/BlueGeneP-base.cmake +++ b/Modules/Platform/BlueGeneP-base.cmake @@ -50,11 +50,6 @@ set(CMAKE_SYSTEM_IGNORE_PATH ) # -# Indicate that this is a unix-like system -# -set(UNIX 1) - -# # Library prefixes, suffixes, extra libs. # set(CMAKE_LINK_LIBRARY_SUFFIX "") diff --git a/Modules/Platform/BlueGeneP-dynamic-Initialize.cmake b/Modules/Platform/BlueGeneP-dynamic-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/BlueGeneP-static-Initialize.cmake b/Modules/Platform/BlueGeneP-static-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/BlueGeneQ-base.cmake b/Modules/Platform/BlueGeneQ-base.cmake index 94cb0a8..ea4b789 100644 --- a/Modules/Platform/BlueGeneQ-base.cmake +++ b/Modules/Platform/BlueGeneQ-base.cmake @@ -40,11 +40,6 @@ set(CMAKE_SYSTEM_IGNORE_PATH ) # -# Indicate that this is a unix-like system -# -set(UNIX 1) - -# # Library prefixes, suffixes, extra libs. # set(CMAKE_LINK_LIBRARY_SUFFIX "") diff --git a/Modules/Platform/BlueGeneQ-dynamic-Initialize.cmake b/Modules/Platform/BlueGeneQ-dynamic-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BlueGeneQ-dynamic-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/BlueGeneQ-static-Initialize.cmake b/Modules/Platform/BlueGeneQ-static-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/BlueGeneQ-static-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/CYGWIN-Initialize.cmake b/Modules/Platform/CYGWIN-Initialize.cmake new file mode 100644 index 0000000..c90c51e --- /dev/null +++ b/Modules/Platform/CYGWIN-Initialize.cmake @@ -0,0 +1,2 @@ +set(CYGWIN 1) +set(UNIX 1) diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake index 0b64496..cf5e732 100644 --- a/Modules/Platform/CYGWIN.cmake +++ b/Modules/Platform/CYGWIN.cmake @@ -1,5 +1,3 @@ -set(CYGWIN 1) - set(CMAKE_SHARED_LIBRARY_PREFIX "cyg") set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") set(CMAKE_SHARED_MODULE_PREFIX "cyg") diff --git a/Modules/Platform/Catamount-Initialize.cmake b/Modules/Platform/Catamount-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/Catamount-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/CrayLinuxEnvironment-Initialize.cmake b/Modules/Platform/CrayLinuxEnvironment-Initialize.cmake new file mode 100644 index 0000000..32cd009 --- /dev/null +++ b/Modules/Platform/CrayLinuxEnvironment-Initialize.cmake @@ -0,0 +1,4 @@ +# CrayLinuxEnvironment: loaded by users cross-compiling on a Cray front-end +# node by specifying "-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment" to cmake + +set(UNIX 1) diff --git a/Modules/Platform/CrayLinuxEnvironment.cmake b/Modules/Platform/CrayLinuxEnvironment.cmake index b982b3f..648806f 100644 --- a/Modules/Platform/CrayLinuxEnvironment.cmake +++ b/Modules/Platform/CrayLinuxEnvironment.cmake @@ -1,8 +1,6 @@ # CrayLinuxEnvironment: loaded by users cross-compiling on a Cray front-end # node by specifying "-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment" to cmake -set(UNIX 1) - if(DEFINED ENV{CRAYOS_VERSION}) set(CMAKE_SYSTEM_VERSION "$ENV{CRAYOS_VERSION}") elseif(DEFINED ENV{XTOS_VERSION}) diff --git a/Modules/Platform/DOS-Initialize.cmake b/Modules/Platform/DOS-Initialize.cmake new file mode 100644 index 0000000..10b0cbf --- /dev/null +++ b/Modules/Platform/DOS-Initialize.cmake @@ -0,0 +1 @@ +set(DOS 1) diff --git a/Modules/Platform/DOS.cmake b/Modules/Platform/DOS.cmake index fc95936..856f4b1 100644 --- a/Modules/Platform/DOS.cmake +++ b/Modules/Platform/DOS.cmake @@ -1,5 +1,3 @@ -set(DOS 1) - set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") set(CMAKE_SHARED_LIBRARY_PREFIX "") diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index c2f1851..e253392 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -1,3 +1,6 @@ +set(APPLE 1) +set(UNIX 1) + # Ask xcode-select where to find /Developer or fall back to ancient location. execute_process(COMMAND xcode-select -print-path OUTPUT_VARIABLE _stdout diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index a6c86f1..48a9065 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -1,5 +1,3 @@ -set(APPLE 1) - if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") if(NOT DEFINED CMAKE_MACOSX_BUNDLE) set(CMAKE_MACOSX_BUNDLE ON) diff --git a/Modules/Platform/DragonFly-Initialize.cmake b/Modules/Platform/DragonFly-Initialize.cmake new file mode 100644 index 0000000..ded94a9 --- /dev/null +++ b/Modules/Platform/DragonFly-Initialize.cmake @@ -0,0 +1,2 @@ +include(Platform/FreeBSD-Initialize) +set(BSD "DragonFlyBSD") diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake index 994ba79..12e5f3c 100644 --- a/Modules/Platform/DragonFly.cmake +++ b/Modules/Platform/DragonFly.cmake @@ -3,7 +3,6 @@ # see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361 include(Platform/FreeBSD) -set(BSD "DragonFlyBSD") # DragonFly BSD requires -z origin to enable $ORIGIN expansion in RPATH. # This is not required for FreeBSD since 10.2-RELEASE. diff --git a/Modules/Platform/FreeBSD-Initialize.cmake b/Modules/Platform/FreeBSD-Initialize.cmake new file mode 100644 index 0000000..8c62a04 --- /dev/null +++ b/Modules/Platform/FreeBSD-Initialize.cmake @@ -0,0 +1,2 @@ +set(BSD "FreeBSD") +set(UNIX 1) diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index 9cd9399..bd5a786 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -1,4 +1,3 @@ -set(BSD "FreeBSD") set(CMAKE_DL_LIBS "") set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") diff --git a/Modules/Platform/Fuchsia-Initialize.cmake b/Modules/Platform/Fuchsia-Initialize.cmake new file mode 100644 index 0000000..74b880a --- /dev/null +++ b/Modules/Platform/Fuchsia-Initialize.cmake @@ -0,0 +1 @@ +set(FUCHSIA 1) diff --git a/Modules/Platform/Fuchsia.cmake b/Modules/Platform/Fuchsia.cmake index 4b13805..ad3a365 100644 --- a/Modules/Platform/Fuchsia.cmake +++ b/Modules/Platform/Fuchsia.cmake @@ -1,5 +1,3 @@ -set(FUCHSIA 1) - set(CMAKE_DL_LIBS "") set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") diff --git a/Modules/Platform/GNU-Initialize.cmake b/Modules/Platform/GNU-Initialize.cmake index 37875ab..3db6cff18 100644 --- a/Modules/Platform/GNU-Initialize.cmake +++ b/Modules/Platform/GNU-Initialize.cmake @@ -1 +1,3 @@ +set(UNIX 1) + set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*") diff --git a/Modules/Platform/HP-UX-Initialize.cmake b/Modules/Platform/HP-UX-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/HP-UX-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/Haiku-Initialize.cmake b/Modules/Platform/Haiku-Initialize.cmake new file mode 100644 index 0000000..fa9d456 --- /dev/null +++ b/Modules/Platform/Haiku-Initialize.cmake @@ -0,0 +1,2 @@ +set(HAIKU 1) +set(UNIX 1) diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake index b8e3ba6..7d9a737 100644 --- a/Modules/Platform/Haiku.cmake +++ b/Modules/Platform/Haiku.cmake @@ -1,6 +1,3 @@ -set(HAIKU 1) -set(UNIX 1) - set(CMAKE_DL_LIBS "") set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") diff --git a/Modules/Platform/Linux-Initialize.cmake b/Modules/Platform/Linux-Initialize.cmake index 6d9cbae..7166b20 100644 --- a/Modules/Platform/Linux-Initialize.cmake +++ b/Modules/Platform/Linux-Initialize.cmake @@ -1,2 +1,5 @@ +set(LINUX 1) +set(UNIX 1) + # Match multiarch library directory names. set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*") diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index 1f2d8e6..97a116f 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -1,4 +1,3 @@ -set(LINUX 1) set(CMAKE_DL_LIBS "dl") set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") diff --git a/Modules/Platform/MP-RAS-Initialize.cmake b/Modules/Platform/MP-RAS-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/MP-RAS-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/MSYS-Initialize.cmake b/Modules/Platform/MSYS-Initialize.cmake new file mode 100644 index 0000000..cc33f87 --- /dev/null +++ b/Modules/Platform/MSYS-Initialize.cmake @@ -0,0 +1,2 @@ +set(MSYS 1) +include(Platform/CYGWIN-Initialize) diff --git a/Modules/Platform/MSYS.cmake b/Modules/Platform/MSYS.cmake index 96fa36f..468718d 100644 --- a/Modules/Platform/MSYS.cmake +++ b/Modules/Platform/MSYS.cmake @@ -1,4 +1,3 @@ -set(MSYS 1) include(Platform/CYGWIN) set(CMAKE_SHARED_LIBRARY_PREFIX "msys-") set(CMAKE_SHARED_MODULE_PREFIX "msys-") diff --git a/Modules/Platform/Midipix-Initialize.cmake b/Modules/Platform/Midipix-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/Midipix-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/NetBSD-Initialize.cmake b/Modules/Platform/NetBSD-Initialize.cmake new file mode 100644 index 0000000..055216d --- /dev/null +++ b/Modules/Platform/NetBSD-Initialize.cmake @@ -0,0 +1,2 @@ +set(BSD "NetBSD") +set(UNIX 1) diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index 52c6594..ab85923 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -1,4 +1,3 @@ -set(BSD "NetBSD") set(CMAKE_DL_LIBS "") set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC") set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE") diff --git a/Modules/Platform/OSF1-Initialize.cmake b/Modules/Platform/OSF1-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/OSF1-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/OpenBSD-Initialize.cmake b/Modules/Platform/OpenBSD-Initialize.cmake new file mode 100644 index 0000000..dee9a87 --- /dev/null +++ b/Modules/Platform/OpenBSD-Initialize.cmake @@ -0,0 +1,2 @@ +include(Platform/NetBSD-Initialize) +set(BSD "OpenBSD") diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake index 51ea60d..97e2a6a 100644 --- a/Modules/Platform/OpenBSD.cmake +++ b/Modules/Platform/OpenBSD.cmake @@ -1,5 +1,4 @@ include(Platform/NetBSD) -set(BSD "OpenBSD") # On OpenBSD, the compile time linker does not share it's configuration with # the runtime linker. This will extract the library search paths from the diff --git a/Modules/Platform/OpenVMS-Initialize.cmake b/Modules/Platform/OpenVMS-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/OpenVMS-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/QNX-Initialize.cmake b/Modules/Platform/QNX-Initialize.cmake index 21a2cdd..c74ff04 100644 --- a/Modules/Platform/QNX-Initialize.cmake +++ b/Modules/Platform/QNX-Initialize.cmake @@ -1,2 +1,3 @@ +set(QNXNTO 1) include(Platform/GNU-Initialize) unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX) diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake index f093314..be105a0 100644 --- a/Modules/Platform/QNX.cmake +++ b/Modules/Platform/QNX.cmake @@ -1,5 +1,3 @@ -set(QNXNTO 1) - include(Platform/GNU) set(CMAKE_DL_LIBS "") diff --git a/Modules/Platform/RISCos-Initialize.cmake b/Modules/Platform/RISCos-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/RISCos-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/SCO_SV-Initialize.cmake b/Modules/Platform/SCO_SV-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/SCO_SV-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/SINIX-Initialize.cmake b/Modules/Platform/SINIX-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/SINIX-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/SerenityOS-Initialize.cmake b/Modules/Platform/SerenityOS-Initialize.cmake new file mode 100644 index 0000000..e6ad610 --- /dev/null +++ b/Modules/Platform/SerenityOS-Initialize.cmake @@ -0,0 +1,2 @@ +set(SERENITYOS 1) +set(UNIX 1) diff --git a/Modules/Platform/SerenityOS.cmake b/Modules/Platform/SerenityOS.cmake index dc4f369..fa3d3ce 100644 --- a/Modules/Platform/SerenityOS.cmake +++ b/Modules/Platform/SerenityOS.cmake @@ -1,6 +1,3 @@ - -set(SERENITYOS 1) - set(CMAKE_DL_LIBS "") set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN") set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") diff --git a/Modules/Platform/SunOS-Initialize.cmake b/Modules/Platform/SunOS-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/SunOS-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/Tru64-Initialize.cmake b/Modules/Platform/Tru64-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/Tru64-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/ULTRIX-Initialize.cmake b/Modules/Platform/ULTRIX-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/ULTRIX-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/UNIX_SV-Initialize.cmake b/Modules/Platform/UNIX_SV-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/UNIX_SV-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index 8a0ad23..32bc7bd 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake @@ -12,6 +12,9 @@ if(__UNIX_PATHS_INCLUDED) endif() set(__UNIX_PATHS_INCLUDED 1) +# Since CMake 3.27, the Platform/-Initialize modules set UNIX +# if the corresponding Platform/ modules includes UnixPaths. +# Retain the setting here to support externally-maintained platform modules. set(UNIX 1) # also add the install directory of the running cmake to the search directories diff --git a/Modules/Platform/UnixWare-Initialize.cmake b/Modules/Platform/UnixWare-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/UnixWare-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/Windows-Initialize.cmake b/Modules/Platform/Windows-Initialize.cmake new file mode 100644 index 0000000..ecb2cf0 --- /dev/null +++ b/Modules/Platform/Windows-Initialize.cmake @@ -0,0 +1 @@ +set(WIN32 1) diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index d8b3957..8697e7a 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -1,13 +1,3 @@ -set(WIN32 1) - -if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE") - set(WINCE 1) -elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") - set(WINDOWS_PHONE 1) -elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(WINDOWS_STORE 1) -endif() - set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") set(CMAKE_SHARED_LIBRARY_PREFIX "") # lib diff --git a/Modules/Platform/WindowsCE-Initialize.cmake b/Modules/Platform/WindowsCE-Initialize.cmake new file mode 100644 index 0000000..32351a9 --- /dev/null +++ b/Modules/Platform/WindowsCE-Initialize.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Initialize) +set(WINCE 1) diff --git a/Modules/Platform/WindowsPhone-Initialize.cmake b/Modules/Platform/WindowsPhone-Initialize.cmake new file mode 100644 index 0000000..c591881 --- /dev/null +++ b/Modules/Platform/WindowsPhone-Initialize.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Initialize) +set(WINDOWS_PHONE 1) diff --git a/Modules/Platform/WindowsStore-Initialize.cmake b/Modules/Platform/WindowsStore-Initialize.cmake new file mode 100644 index 0000000..43374c2 --- /dev/null +++ b/Modules/Platform/WindowsStore-Initialize.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Initialize) +set(WINDOWS_STORE 1) diff --git a/Modules/Platform/Xenix-Initialize.cmake b/Modules/Platform/Xenix-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/Xenix-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/eCos-Initialize.cmake b/Modules/Platform/eCos-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/eCos-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) diff --git a/Modules/Platform/syllable-Initialize.cmake b/Modules/Platform/syllable-Initialize.cmake new file mode 100644 index 0000000..0b117a7 --- /dev/null +++ b/Modules/Platform/syllable-Initialize.cmake @@ -0,0 +1 @@ +set(UNIX 1) -- cgit v0.12