From c1c4cf9545d17928c065fca344c48e03b80291f0 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Wed, 5 Jun 2024 18:48:02 +0200 Subject: [PATCH 1/2] Linker configuration: introduce a new architecture A new set of files are dedicated to linker configuration. This set of files enable a fine-tuned configuration based of the linker type as identified during compiler detection. Fixes: #25360 --- Modules/CMakeCommonLanguageInclude.cmake | 9 --- Modules/CMakeSwiftInformation.cmake | 9 --- Modules/Compiler/GNU.cmake | 54 --------------- .../CMakeASM-ATTLinkerInformation.cmake | 10 +++ .../Internal/CMakeASMLinkerInformation.cmake | 35 ++++++++++ .../CMakeASM_MARMASMLinkerInformation.cmake | 10 +++ .../CMakeASM_MASMLinkerInformation.cmake | 10 +++ .../CMakeASM_NASMLinkerInformation.cmake | 10 +++ .../Internal/CMakeCLinkerInformation.cmake | 39 +++++++++++ .../CMakeCSharpLinkerInformation.cmake | 8 +++ .../Internal/CMakeCUDALinkerInformation.cmake | 39 +++++++++++ .../Internal/CMakeCXXLinkerInformation.cmake | 39 +++++++++++ .../CMakeCommonLinkerInformation.cmake | 18 +++++ .../CMakeFortranLinkerInformation.cmake | 39 +++++++++++ .../Internal/CMakeHIPLinkerInformation.cmake | 39 +++++++++++ .../Internal/CMakeISPCLinkerInformation.cmake | 8 +++ .../Internal/CMakeJavaLinkerInformation.cmake | 5 ++ .../Internal/CMakeOBJCLinkerInformation.cmake | 39 +++++++++++ .../CMakeOBJCXXLinkerInformation.cmake | 39 +++++++++++ .../Internal/CMakeRCLinkerInformation.cmake | 17 +++++ .../CMakeSwiftLinkerInformation.cmake | 39 +++++++++++ Modules/Linker/AIX-ASM.cmake | 6 ++ Modules/Linker/AIX-C.cmake | 6 ++ Modules/Linker/AIX-CXX.cmake | 6 ++ Modules/Linker/AIX-Fortran.cmake | 6 ++ Modules/Linker/AIX.cmake | 9 +++ Modules/Linker/AppleClang-ASM.cmake | 3 + Modules/Linker/AppleClang-C.cmake | 3 + Modules/Linker/AppleClang-CXX.cmake | 3 + Modules/Linker/AppleClang-OBJC.cmake | 3 + Modules/Linker/AppleClang-OBJCXX.cmake | 3 + Modules/Linker/AppleClang.cmake | 10 +++ Modules/Linker/GNU-ASM.cmake | 6 ++ Modules/Linker/GNU-C.cmake | 6 ++ Modules/Linker/GNU-CUDA.cmake | 6 ++ Modules/Linker/GNU-CXX.cmake | 6 ++ Modules/Linker/GNU-Fortran.cmake | 6 ++ Modules/Linker/GNU-HIP.cmake | 6 ++ Modules/Linker/GNU.cmake | 67 +++++++++++++++++++ Modules/Linker/GNUgold-ASM.cmake | 6 ++ Modules/Linker/GNUgold-C.cmake | 6 ++ Modules/Linker/GNUgold-CUDA.cmake | 6 ++ Modules/Linker/GNUgold-CXX.cmake | 6 ++ Modules/Linker/GNUgold-Fortran.cmake | 6 ++ Modules/Linker/GNUgold-HIP.cmake | 6 ++ Modules/Linker/GNUgold.cmake | 18 +++++ Modules/Linker/LLD-ASM.cmake | 6 ++ Modules/Linker/LLD-C.cmake | 6 ++ Modules/Linker/LLD-CUDA.cmake | 6 ++ Modules/Linker/LLD-CXX.cmake | 6 ++ Modules/Linker/LLD-Fortran.cmake | 6 ++ Modules/Linker/LLD-HIP.cmake | 6 ++ Modules/Linker/LLD-OBJC.cmake | 6 ++ Modules/Linker/LLD-OBJCXX.cmake | 6 ++ Modules/Linker/LLD.cmake | 10 +++ Modules/Linker/MOLD-ASM.cmake | 6 ++ Modules/Linker/MOLD-C.cmake | 6 ++ Modules/Linker/MOLD-CUDA.cmake | 6 ++ Modules/Linker/MOLD-CXX.cmake | 6 ++ Modules/Linker/MOLD-Fortran.cmake | 6 ++ Modules/Linker/MOLD-HIP.cmake | 6 ++ Modules/Linker/MOLD-OBJC.cmake | 6 ++ Modules/Linker/MOLD-OBJCXX.cmake | 6 ++ Modules/Linker/Solaris-ASM.cmake | 6 ++ Modules/Linker/Solaris-C.cmake | 6 ++ Modules/Linker/Solaris-CXX.cmake | 6 ++ Modules/Linker/Solaris-Fortran.cmake | 6 ++ Modules/Linker/Solaris.cmake | 9 +++ Modules/Platform/AIX-GNU.cmake | 1 - Modules/Platform/AIX-XL.cmake | 1 - Modules/Platform/Apple-Clang.cmake | 2 - Modules/Platform/Linker/AIX-AIX-ASM.cmake | 6 ++ Modules/Platform/Linker/AIX-AIX-C.cmake | 6 ++ Modules/Platform/Linker/AIX-AIX-CXX.cmake | 6 ++ Modules/Platform/Linker/AIX-AIX-Fortran.cmake | 6 ++ Modules/Platform/Linker/AIX-AIX.cmake | 10 +++ Modules/Platform/Linker/AIX-ASM.cmake | 5 ++ Modules/Platform/Linker/AIX-C.cmake | 5 ++ Modules/Platform/Linker/AIX-CXX.cmake | 5 ++ Modules/Platform/Linker/AIX-Fortran.cmake | 5 ++ Modules/Platform/Linker/Apple-ASM.cmake | 5 ++ .../Linker/Apple-AppleClang-ASM.cmake | 6 ++ .../Platform/Linker/Apple-AppleClang-C.cmake | 6 ++ .../Linker/Apple-AppleClang-CUDA.cmake | 6 ++ .../Linker/Apple-AppleClang-CXX.cmake | 6 ++ .../Linker/Apple-AppleClang-Fortran.cmake | 6 ++ .../Linker/Apple-AppleClang-OBJC.cmake | 6 ++ .../Linker/Apple-AppleClang-OBJCXX.cmake | 6 ++ .../Platform/Linker/Apple-AppleClang.cmake | 10 +++ Modules/Platform/Linker/Apple-C.cmake | 5 ++ Modules/Platform/Linker/Apple-CUDA.cmake | 5 ++ Modules/Platform/Linker/Apple-CXX.cmake | 5 ++ Modules/Platform/Linker/Apple-Fortran.cmake | 5 ++ Modules/Platform/Linker/Apple-LLD-C.cmake | 4 ++ Modules/Platform/Linker/Apple-LLD-CXX.cmake | 4 ++ Modules/Platform/Linker/Apple-LLD-OBJC.cmake | 4 ++ .../Platform/Linker/Apple-LLD-OBJCXX.cmake | 4 ++ Modules/Platform/Linker/Apple-MOLD-C.cmake | 4 ++ Modules/Platform/Linker/Apple-MOLD-CXX.cmake | 4 ++ Modules/Platform/Linker/Apple-MOLD-OBJC.cmake | 4 ++ .../Platform/Linker/Apple-MOLD-OBJCXX.cmake | 4 ++ Modules/Platform/Linker/Apple-OBJC.cmake | 5 ++ Modules/Platform/Linker/Apple-OBJCXX.cmake | 5 ++ .../Linker/BSD-Linker-Initialize.cmake | 22 ++++++ Modules/Platform/Linker/CYGWIN-ASM.cmake | 5 ++ Modules/Platform/Linker/CYGWIN-C.cmake | 5 ++ Modules/Platform/Linker/CYGWIN-CXX.cmake | 5 ++ Modules/Platform/Linker/CYGWIN-Fortran.cmake | 5 ++ Modules/Platform/Linker/CYGWIN-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-GNU-C.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-GNU-CXX.cmake | 6 ++ .../Platform/Linker/CYGWIN-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-GNU.cmake | 9 +++ Modules/Platform/Linker/CYGWIN-LLD-ASM.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-LLD-C.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-LLD-CXX.cmake | 6 ++ .../Platform/Linker/CYGWIN-LLD-Fortran.cmake | 6 ++ Modules/Platform/Linker/CYGWIN-LLD.cmake | 16 +++++ Modules/Platform/Linker/DragonFly-ASM.cmake | 4 ++ Modules/Platform/Linker/DragonFly-C.cmake | 4 ++ Modules/Platform/Linker/DragonFly-CXX.cmake | 4 ++ .../Platform/Linker/DragonFly-Fortran.cmake | 4 ++ .../Platform/Linker/DragonFly-GNU-ASM.cmake | 4 ++ Modules/Platform/Linker/DragonFly-GNU-C.cmake | 4 ++ .../Platform/Linker/DragonFly-GNU-CXX.cmake | 4 ++ .../Linker/DragonFly-GNU-Fortran.cmake | 4 ++ .../Platform/Linker/DragonFly-LLD-ASM.cmake | 4 ++ Modules/Platform/Linker/DragonFly-LLD-C.cmake | 4 ++ .../Platform/Linker/DragonFly-LLD-CXX.cmake | 4 ++ .../Linker/DragonFly-LLD-Fortran.cmake | 4 ++ Modules/Platform/Linker/FreeBSD-ASM.cmake | 15 +++++ Modules/Platform/Linker/FreeBSD-C.cmake | 15 +++++ Modules/Platform/Linker/FreeBSD-CXX.cmake | 15 +++++ Modules/Platform/Linker/FreeBSD-Fortran.cmake | 15 +++++ Modules/Platform/Linker/FreeBSD-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-GNU-C.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-GNU-CXX.cmake | 6 ++ .../Platform/Linker/FreeBSD-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-GNU.cmake | 9 +++ Modules/Platform/Linker/FreeBSD-LLD-ASM.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-LLD-C.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-LLD-CXX.cmake | 6 ++ .../Platform/Linker/FreeBSD-LLD-Fortran.cmake | 6 ++ Modules/Platform/Linker/FreeBSD-LLD.cmake | 16 +++++ Modules/Platform/Linker/GNU-ASM.cmake | 5 ++ Modules/Platform/Linker/GNU-C.cmake | 5 ++ Modules/Platform/Linker/GNU-CXX.cmake | 5 ++ Modules/Platform/Linker/GNU-Fortran.cmake | 5 ++ Modules/Platform/Linker/GNU-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/GNU-GNU-C.cmake | 6 ++ Modules/Platform/Linker/GNU-GNU-CXX.cmake | 6 ++ Modules/Platform/Linker/GNU-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/GNU-GNU.cmake | 9 +++ Modules/Platform/Linker/Linux-ASM.cmake | 5 ++ Modules/Platform/Linker/Linux-C.cmake | 5 ++ Modules/Platform/Linker/Linux-CUDA.cmake | 5 ++ Modules/Platform/Linker/Linux-CXX.cmake | 5 ++ Modules/Platform/Linker/Linux-Fortran.cmake | 5 ++ Modules/Platform/Linker/Linux-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/Linux-GNU-C.cmake | 6 ++ Modules/Platform/Linker/Linux-GNU-CUDA.cmake | 6 ++ Modules/Platform/Linker/Linux-GNU-CXX.cmake | 6 ++ .../Platform/Linker/Linux-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/Linux-GNU-HIP.cmake | 6 ++ Modules/Platform/Linker/Linux-GNU.cmake | 9 +++ .../Platform/Linker/Linux-GNUgold-ASM.cmake | 4 ++ Modules/Platform/Linker/Linux-GNUgold-C.cmake | 4 ++ .../Platform/Linker/Linux-GNUgold-CUDA.cmake | 4 ++ .../Platform/Linker/Linux-GNUgold-CXX.cmake | 4 ++ .../Linker/Linux-GNUgold-Fortran.cmake | 4 ++ .../Platform/Linker/Linux-GNUgold-HIP.cmake | 4 ++ Modules/Platform/Linker/Linux-HIP.cmake | 5 ++ Modules/Platform/Linker/Linux-LLD-ASM.cmake | 6 ++ Modules/Platform/Linker/Linux-LLD-C.cmake | 6 ++ Modules/Platform/Linker/Linux-LLD-CUDA.cmake | 6 ++ Modules/Platform/Linker/Linux-LLD-CXX.cmake | 6 ++ .../Platform/Linker/Linux-LLD-Fortran.cmake | 6 ++ Modules/Platform/Linker/Linux-LLD-HIP.cmake | 6 ++ Modules/Platform/Linker/Linux-LLD.cmake | 16 +++++ Modules/Platform/Linker/Linux-MOLD-ASM.cmake | 6 ++ Modules/Platform/Linker/Linux-MOLD-C.cmake | 6 ++ Modules/Platform/Linker/Linux-MOLD-CUDA.cmake | 6 ++ Modules/Platform/Linker/Linux-MOLD-CXX.cmake | 6 ++ .../Platform/Linker/Linux-MOLD-Fortran.cmake | 6 ++ Modules/Platform/Linker/Linux-MOLD-HIP.cmake | 6 ++ Modules/Platform/Linker/Linux-MOLD.cmake | 16 +++++ Modules/Platform/Linker/MSYS-ASM.cmake | 4 ++ Modules/Platform/Linker/MSYS-C.cmake | 4 ++ Modules/Platform/Linker/MSYS-CXX.cmake | 4 ++ Modules/Platform/Linker/MSYS-Fortran.cmake | 4 ++ Modules/Platform/Linker/MSYS-GNU-ASM.cmake | 4 ++ Modules/Platform/Linker/MSYS-GNU-C.cmake | 4 ++ Modules/Platform/Linker/MSYS-GNU-CXX.cmake | 4 ++ .../Platform/Linker/MSYS-GNU-Fortran.cmake | 4 ++ Modules/Platform/Linker/MSYS-LLD-ASM.cmake | 4 ++ Modules/Platform/Linker/MSYS-LLD-C.cmake | 4 ++ Modules/Platform/Linker/MSYS-LLD-CXX.cmake | 4 ++ .../Platform/Linker/MSYS-LLD-Fortran.cmake | 4 ++ Modules/Platform/Linker/MirBSD-ASM.cmake | 4 ++ Modules/Platform/Linker/MirBSD-C.cmake | 4 ++ Modules/Platform/Linker/MirBSD-CXX.cmake | 4 ++ Modules/Platform/Linker/MirBSD-Fortran.cmake | 4 ++ Modules/Platform/Linker/MirBSD-GNU-ASM.cmake | 4 ++ Modules/Platform/Linker/MirBSD-GNU-C.cmake | 4 ++ Modules/Platform/Linker/MirBSD-GNU-CXX.cmake | 4 ++ .../Platform/Linker/MirBSD-GNU-Fortran.cmake | 4 ++ Modules/Platform/Linker/NetBSD-ASM.cmake | 5 ++ Modules/Platform/Linker/NetBSD-C.cmake | 5 ++ Modules/Platform/Linker/NetBSD-CXX.cmake | 5 ++ Modules/Platform/Linker/NetBSD-Fortran.cmake | 5 ++ Modules/Platform/Linker/NetBSD-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/NetBSD-GNU-C.cmake | 6 ++ Modules/Platform/Linker/NetBSD-GNU-CXX.cmake | 6 ++ .../Platform/Linker/NetBSD-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/NetBSD-GNU.cmake | 9 +++ Modules/Platform/Linker/OpenBSD-ASM.cmake | 15 +++++ Modules/Platform/Linker/OpenBSD-C.cmake | 15 +++++ Modules/Platform/Linker/OpenBSD-CXX.cmake | 15 +++++ Modules/Platform/Linker/OpenBSD-Fortran.cmake | 15 +++++ Modules/Platform/Linker/OpenBSD-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-GNU-C.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-GNU-CXX.cmake | 6 ++ .../Platform/Linker/OpenBSD-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-GNU.cmake | 9 +++ Modules/Platform/Linker/OpenBSD-LLD-ASM.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-LLD-C.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-LLD-CXX.cmake | 6 ++ .../Platform/Linker/OpenBSD-LLD-Fortran.cmake | 6 ++ Modules/Platform/Linker/OpenBSD-LLD.cmake | 16 +++++ Modules/Platform/Linker/SerenityOS-ASM.cmake | 5 ++ Modules/Platform/Linker/SerenityOS-C.cmake | 5 ++ Modules/Platform/Linker/SerenityOS-CXX.cmake | 5 ++ .../Platform/Linker/SerenityOS-GNU-ASM.cmake | 6 ++ .../Platform/Linker/SerenityOS-GNU-C.cmake | 6 ++ .../Platform/Linker/SerenityOS-GNU-CXX.cmake | 6 ++ Modules/Platform/Linker/SerenityOS-GNU.cmake | 9 +++ .../Platform/Linker/SerenityOS-LLD-ASM.cmake | 6 ++ .../Platform/Linker/SerenityOS-LLD-C.cmake | 6 ++ .../Platform/Linker/SerenityOS-LLD-CXX.cmake | 6 ++ Modules/Platform/Linker/SerenityOS-LLD.cmake | 16 +++++ Modules/Platform/Linker/SunOS-ASM.cmake | 5 ++ Modules/Platform/Linker/SunOS-C.cmake | 5 ++ Modules/Platform/Linker/SunOS-CXX.cmake | 5 ++ Modules/Platform/Linker/SunOS-Fortran.cmake | 5 ++ Modules/Platform/Linker/SunOS-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/SunOS-GNU-C.cmake | 6 ++ Modules/Platform/Linker/SunOS-GNU-CXX.cmake | 6 ++ .../Platform/Linker/SunOS-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/SunOS-GNU.cmake | 9 +++ .../Platform/Linker/SunOS-Solaris-ASM.cmake | 6 ++ Modules/Platform/Linker/SunOS-Solaris-C.cmake | 6 ++ .../Platform/Linker/SunOS-Solaris-CXX.cmake | 6 ++ .../Linker/SunOS-Solaris-Fortran.cmake | 6 ++ Modules/Platform/Linker/SunOS-Solaris.cmake | 9 +++ Modules/Platform/Linker/Windows-ASM.cmake | 15 +++++ Modules/Platform/Linker/Windows-C.cmake | 15 +++++ Modules/Platform/Linker/Windows-CUDA.cmake | 5 ++ Modules/Platform/Linker/Windows-CXX.cmake | 15 +++++ Modules/Platform/Linker/Windows-Fortran.cmake | 15 +++++ Modules/Platform/Linker/Windows-GNU-ASM.cmake | 6 ++ Modules/Platform/Linker/Windows-GNU-C.cmake | 6 ++ Modules/Platform/Linker/Windows-GNU-CXX.cmake | 6 ++ .../Platform/Linker/Windows-GNU-Fortran.cmake | 6 ++ Modules/Platform/Linker/Windows-GNU-HIP.cmake | 6 ++ Modules/Platform/Linker/Windows-GNU.cmake | 10 +++ Modules/Platform/Linker/Windows-HIP.cmake | 15 +++++ Modules/Platform/Linker/Windows-LLD-ASM.cmake | 6 ++ Modules/Platform/Linker/Windows-LLD-C.cmake | 6 ++ Modules/Platform/Linker/Windows-LLD-CXX.cmake | 6 ++ Modules/Platform/Linker/Windows-LLD-HIP.cmake | 6 ++ Modules/Platform/Linker/Windows-LLD.cmake | 24 +++++++ .../Platform/Linker/Windows-MSVC-ASM.cmake | 6 ++ Modules/Platform/Linker/Windows-MSVC-C.cmake | 6 ++ .../Platform/Linker/Windows-MSVC-CUDA.cmake | 6 ++ .../Platform/Linker/Windows-MSVC-CXX.cmake | 6 ++ .../Linker/Windows-MSVC-Fortran.cmake | 6 ++ .../Platform/Linker/Windows-MSVC-HIP.cmake | 6 ++ Modules/Platform/Linker/Windows-MSVC.cmake | 11 +++ Modules/Platform/Windows-Clang.cmake | 2 - Modules/Platform/Windows-MSVC.cmake | 2 - Source/cmGlobalGenerator.cxx | 19 ++++++ 281 files changed, 2184 insertions(+), 80 deletions(-) create mode 100644 Modules/Internal/CMakeASM-ATTLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeASMLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeASM_MARMASMLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeASM_MASMLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeASM_NASMLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeCLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeCSharpLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeCUDALinkerInformation.cmake create mode 100644 Modules/Internal/CMakeCXXLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeCommonLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeFortranLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeHIPLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeISPCLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeJavaLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeOBJCLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeOBJCXXLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeRCLinkerInformation.cmake create mode 100644 Modules/Internal/CMakeSwiftLinkerInformation.cmake create mode 100644 Modules/Linker/AIX-ASM.cmake create mode 100644 Modules/Linker/AIX-C.cmake create mode 100644 Modules/Linker/AIX-CXX.cmake create mode 100644 Modules/Linker/AIX-Fortran.cmake create mode 100644 Modules/Linker/AIX.cmake create mode 100644 Modules/Linker/AppleClang-ASM.cmake create mode 100644 Modules/Linker/AppleClang-C.cmake create mode 100644 Modules/Linker/AppleClang-CXX.cmake create mode 100644 Modules/Linker/AppleClang-OBJC.cmake create mode 100644 Modules/Linker/AppleClang-OBJCXX.cmake create mode 100644 Modules/Linker/AppleClang.cmake create mode 100644 Modules/Linker/GNU-ASM.cmake create mode 100644 Modules/Linker/GNU-C.cmake create mode 100644 Modules/Linker/GNU-CUDA.cmake create mode 100644 Modules/Linker/GNU-CXX.cmake create mode 100644 Modules/Linker/GNU-Fortran.cmake create mode 100644 Modules/Linker/GNU-HIP.cmake create mode 100644 Modules/Linker/GNU.cmake create mode 100644 Modules/Linker/GNUgold-ASM.cmake create mode 100644 Modules/Linker/GNUgold-C.cmake create mode 100644 Modules/Linker/GNUgold-CUDA.cmake create mode 100644 Modules/Linker/GNUgold-CXX.cmake create mode 100644 Modules/Linker/GNUgold-Fortran.cmake create mode 100644 Modules/Linker/GNUgold-HIP.cmake create mode 100644 Modules/Linker/GNUgold.cmake create mode 100644 Modules/Linker/LLD-ASM.cmake create mode 100644 Modules/Linker/LLD-C.cmake create mode 100644 Modules/Linker/LLD-CUDA.cmake create mode 100644 Modules/Linker/LLD-CXX.cmake create mode 100644 Modules/Linker/LLD-Fortran.cmake create mode 100644 Modules/Linker/LLD-HIP.cmake create mode 100644 Modules/Linker/LLD-OBJC.cmake create mode 100644 Modules/Linker/LLD-OBJCXX.cmake create mode 100644 Modules/Linker/LLD.cmake create mode 100644 Modules/Linker/MOLD-ASM.cmake create mode 100644 Modules/Linker/MOLD-C.cmake create mode 100644 Modules/Linker/MOLD-CUDA.cmake create mode 100644 Modules/Linker/MOLD-CXX.cmake create mode 100644 Modules/Linker/MOLD-Fortran.cmake create mode 100644 Modules/Linker/MOLD-HIP.cmake create mode 100644 Modules/Linker/MOLD-OBJC.cmake create mode 100644 Modules/Linker/MOLD-OBJCXX.cmake create mode 100644 Modules/Linker/Solaris-ASM.cmake create mode 100644 Modules/Linker/Solaris-C.cmake create mode 100644 Modules/Linker/Solaris-CXX.cmake create mode 100644 Modules/Linker/Solaris-Fortran.cmake create mode 100644 Modules/Linker/Solaris.cmake create mode 100644 Modules/Platform/Linker/AIX-AIX-ASM.cmake create mode 100644 Modules/Platform/Linker/AIX-AIX-C.cmake create mode 100644 Modules/Platform/Linker/AIX-AIX-CXX.cmake create mode 100644 Modules/Platform/Linker/AIX-AIX-Fortran.cmake create mode 100644 Modules/Platform/Linker/AIX-AIX.cmake create mode 100644 Modules/Platform/Linker/AIX-ASM.cmake create mode 100644 Modules/Platform/Linker/AIX-C.cmake create mode 100644 Modules/Platform/Linker/AIX-CXX.cmake create mode 100644 Modules/Platform/Linker/AIX-Fortran.cmake create mode 100644 Modules/Platform/Linker/Apple-ASM.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-ASM.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-C.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-CUDA.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-CXX.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-Fortran.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-OBJC.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang-OBJCXX.cmake create mode 100644 Modules/Platform/Linker/Apple-AppleClang.cmake create mode 100644 Modules/Platform/Linker/Apple-C.cmake create mode 100644 Modules/Platform/Linker/Apple-CUDA.cmake create mode 100644 Modules/Platform/Linker/Apple-CXX.cmake create mode 100644 Modules/Platform/Linker/Apple-Fortran.cmake create mode 100644 Modules/Platform/Linker/Apple-LLD-C.cmake create mode 100644 Modules/Platform/Linker/Apple-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/Apple-LLD-OBJC.cmake create mode 100644 Modules/Platform/Linker/Apple-LLD-OBJCXX.cmake create mode 100644 Modules/Platform/Linker/Apple-MOLD-C.cmake create mode 100644 Modules/Platform/Linker/Apple-MOLD-CXX.cmake create mode 100644 Modules/Platform/Linker/Apple-MOLD-OBJC.cmake create mode 100644 Modules/Platform/Linker/Apple-MOLD-OBJCXX.cmake create mode 100644 Modules/Platform/Linker/Apple-OBJC.cmake create mode 100644 Modules/Platform/Linker/Apple-OBJCXX.cmake create mode 100644 Modules/Platform/Linker/BSD-Linker-Initialize.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-ASM.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-C.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-CXX.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-Fortran.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-GNU-C.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-GNU.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-LLD-C.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/CYGWIN-LLD.cmake create mode 100644 Modules/Platform/Linker/DragonFly-ASM.cmake create mode 100644 Modules/Platform/Linker/DragonFly-C.cmake create mode 100644 Modules/Platform/Linker/DragonFly-CXX.cmake create mode 100644 Modules/Platform/Linker/DragonFly-Fortran.cmake create mode 100644 Modules/Platform/Linker/DragonFly-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/DragonFly-GNU-C.cmake create mode 100644 Modules/Platform/Linker/DragonFly-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/DragonFly-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/DragonFly-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/DragonFly-LLD-C.cmake create mode 100644 Modules/Platform/Linker/DragonFly-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/DragonFly-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-ASM.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-C.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-CXX.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-Fortran.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-GNU-C.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-GNU.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-LLD-C.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/FreeBSD-LLD.cmake create mode 100644 Modules/Platform/Linker/GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/GNU-C.cmake create mode 100644 Modules/Platform/Linker/GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/GNU-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/GNU-GNU-C.cmake create mode 100644 Modules/Platform/Linker/GNU-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/GNU-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/GNU-GNU.cmake create mode 100644 Modules/Platform/Linker/Linux-ASM.cmake create mode 100644 Modules/Platform/Linker/Linux-C.cmake create mode 100644 Modules/Platform/Linker/Linux-CUDA.cmake create mode 100644 Modules/Platform/Linker/Linux-CXX.cmake create mode 100644 Modules/Platform/Linker/Linux-Fortran.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-C.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-CUDA.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU-HIP.cmake create mode 100644 Modules/Platform/Linker/Linux-GNU.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-ASM.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-C.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-CUDA.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-CXX.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-Fortran.cmake create mode 100644 Modules/Platform/Linker/Linux-GNUgold-HIP.cmake create mode 100644 Modules/Platform/Linker/Linux-HIP.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-C.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-CUDA.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD-HIP.cmake create mode 100644 Modules/Platform/Linker/Linux-LLD.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-ASM.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-C.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-CUDA.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-CXX.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD-HIP.cmake create mode 100644 Modules/Platform/Linker/Linux-MOLD.cmake create mode 100644 Modules/Platform/Linker/MSYS-ASM.cmake create mode 100644 Modules/Platform/Linker/MSYS-C.cmake create mode 100644 Modules/Platform/Linker/MSYS-CXX.cmake create mode 100644 Modules/Platform/Linker/MSYS-Fortran.cmake create mode 100644 Modules/Platform/Linker/MSYS-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/MSYS-GNU-C.cmake create mode 100644 Modules/Platform/Linker/MSYS-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/MSYS-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/MSYS-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/MSYS-LLD-C.cmake create mode 100644 Modules/Platform/Linker/MSYS-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/MSYS-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/MirBSD-ASM.cmake create mode 100644 Modules/Platform/Linker/MirBSD-C.cmake create mode 100644 Modules/Platform/Linker/MirBSD-CXX.cmake create mode 100644 Modules/Platform/Linker/MirBSD-Fortran.cmake create mode 100644 Modules/Platform/Linker/MirBSD-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/MirBSD-GNU-C.cmake create mode 100644 Modules/Platform/Linker/MirBSD-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/MirBSD-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/NetBSD-ASM.cmake create mode 100644 Modules/Platform/Linker/NetBSD-C.cmake create mode 100644 Modules/Platform/Linker/NetBSD-CXX.cmake create mode 100644 Modules/Platform/Linker/NetBSD-Fortran.cmake create mode 100644 Modules/Platform/Linker/NetBSD-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/NetBSD-GNU-C.cmake create mode 100644 Modules/Platform/Linker/NetBSD-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/NetBSD-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/NetBSD-GNU.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-ASM.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-C.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-CXX.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-Fortran.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-GNU-C.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-GNU.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-LLD-C.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-LLD-Fortran.cmake create mode 100644 Modules/Platform/Linker/OpenBSD-LLD.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-ASM.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-C.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-CXX.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-GNU-C.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-GNU.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-LLD-C.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/SerenityOS-LLD.cmake create mode 100644 Modules/Platform/Linker/SunOS-ASM.cmake create mode 100644 Modules/Platform/Linker/SunOS-C.cmake create mode 100644 Modules/Platform/Linker/SunOS-CXX.cmake create mode 100644 Modules/Platform/Linker/SunOS-Fortran.cmake create mode 100644 Modules/Platform/Linker/SunOS-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/SunOS-GNU-C.cmake create mode 100644 Modules/Platform/Linker/SunOS-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/SunOS-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/SunOS-GNU.cmake create mode 100644 Modules/Platform/Linker/SunOS-Solaris-ASM.cmake create mode 100644 Modules/Platform/Linker/SunOS-Solaris-C.cmake create mode 100644 Modules/Platform/Linker/SunOS-Solaris-CXX.cmake create mode 100644 Modules/Platform/Linker/SunOS-Solaris-Fortran.cmake create mode 100644 Modules/Platform/Linker/SunOS-Solaris.cmake create mode 100644 Modules/Platform/Linker/Windows-ASM.cmake create mode 100644 Modules/Platform/Linker/Windows-C.cmake create mode 100644 Modules/Platform/Linker/Windows-CUDA.cmake create mode 100644 Modules/Platform/Linker/Windows-CXX.cmake create mode 100644 Modules/Platform/Linker/Windows-Fortran.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU-ASM.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU-C.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU-CXX.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU-Fortran.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU-HIP.cmake create mode 100644 Modules/Platform/Linker/Windows-GNU.cmake create mode 100644 Modules/Platform/Linker/Windows-HIP.cmake create mode 100644 Modules/Platform/Linker/Windows-LLD-ASM.cmake create mode 100644 Modules/Platform/Linker/Windows-LLD-C.cmake create mode 100644 Modules/Platform/Linker/Windows-LLD-CXX.cmake create mode 100644 Modules/Platform/Linker/Windows-LLD-HIP.cmake create mode 100644 Modules/Platform/Linker/Windows-LLD.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-ASM.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-C.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-CUDA.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-CXX.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-Fortran.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC-HIP.cmake create mode 100644 Modules/Platform/Linker/Windows-MSVC.cmake diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake index 5511930fd0..4907a2840e 100644 --- a/Modules/CMakeCommonLanguageInclude.cmake +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -120,13 +120,4 @@ macro(_cmake_common_language_platform_flags lang) ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS}) endif() endforeach() - - if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") - if(NOT DEFINED CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG) - set(CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed") - endif() - if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK) - set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r) - endif() - endif() endmacro() diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 60df6a2087..c495dd9575 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -108,15 +108,6 @@ else() endif() unset(__SWIFT_COMP_MODE_CMP0157) -if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") - if(NOT DEFINED CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG) - set(CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed") - endif() - if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK) - set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r) - endif() -endif() - cmake_initialize_per_config_variable(CMAKE_Swift_FLAGS "Swift Compiler Flags") if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$") diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 3f705a9bfa..83c818d49b 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -52,60 +52,6 @@ macro(__compiler_gnu lang) set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT -MF ") endif() - # define flags for linker depfile generation - set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,") - set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc) - - if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) - ## Ensure ninja tool is recent enough... - if(CMAKE_GENERATOR MATCHES "^Ninja") - # Ninja 1.10 or upper is required - execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version - OUTPUT_VARIABLE _ninja_version - ERROR_VARIABLE _ninja_version) - if (_ninja_version MATCHES "[0-9]+(\\.[0-9]+)*") - set (_ninja_version "${CMAKE_MATCH_0}") - endif() - if (_ninja_version VERSION_LESS "1.10") - set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) - endif() - unset(_ninja_version) - endif() - - if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) - ## check if this feature is supported by the linker - if (CMAKE_${lang}_COMPILER_LINKER AND CMAKE_${lang}_COMPILER_LINKER_ID MATCHES "GNU|LLD") - execute_process(COMMAND "${CMAKE_${lang}_COMPILER_LINKER}" --help - OUTPUT_VARIABLE _linker_capabilities - ERROR_VARIABLE _linker_capabilities) - if(_linker_capabilities MATCHES "--dependency-file") - set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED TRUE) - else() - set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) - endif() - unset(_linker_capabilities) - else() - set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) - endif() - endif() - endif() - if (CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) - set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER TRUE) - else() - set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) - endif() - - # Due to GNU binutils ld bug when LTO is enabled (see GNU bug - # `30568 `_), - # deactivate this feature if the version is less than 2.41. - # For now, all known versions of gold linker have also this bug. - if (CMAKE_${lang}_COMPILER_LINKER_ID - AND (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNUgold" - OR (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNU" - AND CMAKE_${lang}_COMPILER_LINKER_VERSION VERSION_LESS "2.41"))) - set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) - endif() - # Initial configuration flags. string(APPEND CMAKE_${lang}_FLAGS_INIT " ") string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") diff --git a/Modules/Internal/CMakeASM-ATTLinkerInformation.cmake b/Modules/Internal/CMakeASM-ATTLinkerInformation.cmake new file mode 100644 index 0000000000..5e3ae78972 --- /dev/null +++ b/Modules/Internal/CMakeASM-ATTLinkerInformation.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# support for AT&T syntax assemblers, e.g. GNU as + +# Load the generic ASMInformation file: +set(ASM_DIALECT "-ATT") +include(Internal/CMakeASMLinkerInformation) +set(ASM_DIALECT) diff --git a/Modules/Internal/CMakeASMLinkerInformation.cmake b/Modules/Internal/CMakeASMLinkerInformation.cmake new file mode 100644 index 0000000000..5f81b1feba --- /dev/null +++ b/Modules/Internal/CMakeASMLinkerInformation.cmake @@ -0,0 +1,35 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID) + include(Linker/${CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID}-ASM${ASM_DIALECT} OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_LINKER_ID}-ASM${ASM_DIALECT} + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-ASM${ASM_DIALECT} OPTIONAL) +endif () + +set(CMAKE_ASM${ASM_DIALECT}_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeASM_MARMASMLinkerInformation.cmake b/Modules/Internal/CMakeASM_MARMASMLinkerInformation.cmake new file mode 100644 index 0000000000..62497f2f8d --- /dev/null +++ b/Modules/Internal/CMakeASM_MARMASMLinkerInformation.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# support for the MS assembler, masm and masm64 + +# Load the generic ASMInformation file: +set(ASM_DIALECT "_MASM") +include(Internal/CMakeASMLinkerInformation) +set(ASM_DIALECT) diff --git a/Modules/Internal/CMakeASM_MASMLinkerInformation.cmake b/Modules/Internal/CMakeASM_MASMLinkerInformation.cmake new file mode 100644 index 0000000000..62497f2f8d --- /dev/null +++ b/Modules/Internal/CMakeASM_MASMLinkerInformation.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# support for the MS assembler, masm and masm64 + +# Load the generic ASMInformation file: +set(ASM_DIALECT "_MASM") +include(Internal/CMakeASMLinkerInformation) +set(ASM_DIALECT) diff --git a/Modules/Internal/CMakeASM_NASMLinkerInformation.cmake b/Modules/Internal/CMakeASM_NASMLinkerInformation.cmake new file mode 100644 index 0000000000..d48a018602 --- /dev/null +++ b/Modules/Internal/CMakeASM_NASMLinkerInformation.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# support for the nasm assembler + +# Load the generic ASMInformation file: +set(ASM_DIALECT "_NASM") +include(Internal/CMakeASMLinkerInformation) +set(ASM_DIALECT) diff --git a/Modules/Internal/CMakeCLinkerInformation.cmake b/Modules/Internal/CMakeCLinkerInformation.cmake new file mode 100644 index 0000000000..d918f84880 --- /dev/null +++ b/Modules/Internal/CMakeCLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_C_COMPILER_LINKER_ID) + include(Linker/${CMAKE_C_COMPILER_LINKER_ID}-C OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_C_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_LINKER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_C_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_LINKER_ID}-C + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-C OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(C) + +set(CMAKE_C_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeCSharpLinkerInformation.cmake b/Modules/Internal/CMakeCSharpLinkerInformation.cmake new file mode 100644 index 0000000000..ff73a37faa --- /dev/null +++ b/Modules/Internal/CMakeCSharpLinkerInformation.cmake @@ -0,0 +1,8 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the CSharp compiler in CMake. +# For now, nothing to define + +set(CMAKE_CSharp_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeCUDALinkerInformation.cmake b/Modules/Internal/CMakeCUDALinkerInformation.cmake new file mode 100644 index 0000000000..4081e50be1 --- /dev/null +++ b/Modules/Internal/CMakeCUDALinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_CUDA_COMPILER_LINKER_ID) + include(Linker/${CMAKE_CUDA_COMPILER_LINKER_ID}-CUDA OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_CUDA_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_LINKER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_CUDA_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_LINKER_ID}-CUDA + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-CUDA OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(CUDA) + +set(CMAKE_CUDA_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeCXXLinkerInformation.cmake b/Modules/Internal/CMakeCXXLinkerInformation.cmake new file mode 100644 index 0000000000..3929bbbb00 --- /dev/null +++ b/Modules/Internal/CMakeCXXLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C++ compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_CXX_COMPILER_LINKER_ID) + include(Linker/${CMAKE_CXX_COMPILER_LINKER_ID}-CXX OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_CXX_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_LINKER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_CXX_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_LINKER_ID}-CXX + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(CXX) + +set(CMAKE_CXX_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeCommonLinkerInformation.cmake b/Modules/Internal/CMakeCommonLinkerInformation.cmake new file mode 100644 index 0000000000..245e068bb8 --- /dev/null +++ b/Modules/Internal/CMakeCommonLinkerInformation.cmake @@ -0,0 +1,18 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file contains common code blocks used by all the linker information +# files + +macro(_cmake_common_linker_platform_flags lang) + # Define configuration for LINK_WHAT_YOU_USE feature + if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF") + if(NOT DEFINED CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG) + set(CMAKE_${lang}_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed") + endif() + if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK) + set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r) + endif() + endif() +endmacro () diff --git a/Modules/Internal/CMakeFortranLinkerInformation.cmake b/Modules/Internal/CMakeFortranLinkerInformation.cmake new file mode 100644 index 0000000000..a39f3deef2 --- /dev/null +++ b/Modules/Internal/CMakeFortranLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_Fortran_COMPILER_LINKER_ID) + include(Linker/${CMAKE_Fortran_COMPILER_LINKER_ID}-Fortran OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_Fortran_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_LINKER_ID}-Fortran-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_Fortran_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_LINKER_ID}-Fortran + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(Fortran) + +set(CMAKE_Fortran_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeHIPLinkerInformation.cmake b/Modules/Internal/CMakeHIPLinkerInformation.cmake new file mode 100644 index 0000000000..d37d66d9ef --- /dev/null +++ b/Modules/Internal/CMakeHIPLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_HIP_COMPILER_LINKER_ID) + include(Linker/${CMAKE_HIP_COMPILER_LINKER_ID}-HIP OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_HIP_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_HIP_COMPILER_LINKER_ID}-HIP-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_HIP_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_HIP_COMPILER_LINKER_ID}-HIP + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-HIP OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(HIP) + +set(CMAKE_HIP_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeISPCLinkerInformation.cmake b/Modules/Internal/CMakeISPCLinkerInformation.cmake new file mode 100644 index 0000000000..47950aa8c2 --- /dev/null +++ b/Modules/Internal/CMakeISPCLinkerInformation.cmake @@ -0,0 +1,8 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the ISPC compiler in CMake. +# For now, ISPC is not able to handle the link step + +set(CMAKE_ISPC_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeJavaLinkerInformation.cmake b/Modules/Internal/CMakeJavaLinkerInformation.cmake new file mode 100644 index 0000000000..c0edadd0fd --- /dev/null +++ b/Modules/Internal/CMakeJavaLinkerInformation.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# Java language does not have a concept of linker, so nothing to configure. diff --git a/Modules/Internal/CMakeOBJCLinkerInformation.cmake b/Modules/Internal/CMakeOBJCLinkerInformation.cmake new file mode 100644 index 0000000000..ea92880088 --- /dev/null +++ b/Modules/Internal/CMakeOBJCLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the Objective-C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_OBJC_COMPILER_LINKER_ID) + include(Linker/${CMAKE_OBJC_COMPILER_LINKER_ID}-OBJC OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_OBJC_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJC_COMPILER_LINKER_ID}-OBJC-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_OBJC_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJC_COMPILER_LINKER_ID}-OBJC + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-OBJC OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(OBJC) + +set(CMAKE_OBJC_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeOBJCXXLinkerInformation.cmake b/Modules/Internal/CMakeOBJCXXLinkerInformation.cmake new file mode 100644 index 0000000000..3b51ba77b2 --- /dev/null +++ b/Modules/Internal/CMakeOBJCXXLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the Objective-C++ compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_OBJCXX_COMPILER_LINKER_ID) + include(Linker/${CMAKE_OBJCXX_COMPILER_LINKER_ID}-C OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_OBJCXX_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJCXX_COMPILER_LINKER_ID}-OBJCXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_OBJCXX_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJCXX_COMPILER_LINKER_ID}-C + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-OBJCXX OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(OBJCXX) + +set(CMAKE_OBJCXX_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeRCLinkerInformation.cmake b/Modules/Internal/CMakeRCLinkerInformation.cmake new file mode 100644 index 0000000000..1b0563eee5 --- /dev/null +++ b/Modules/Internal/CMakeRCLinkerInformation.cmake @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the C compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Foe now, no linker associated with RC language + +set(CMAKE_RC_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Internal/CMakeSwiftLinkerInformation.cmake b/Modules/Internal/CMakeSwiftLinkerInformation.cmake new file mode 100644 index 0000000000..fb3e9865e5 --- /dev/null +++ b/Modules/Internal/CMakeSwiftLinkerInformation.cmake @@ -0,0 +1,39 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This file sets the basic flags for the linker used by the Swift compiler in CMake. +# It also loads the available platform file for the system-linker +# if it exists. +# It also loads a system - linker - processor (or target hardware) +# specific file, which is mainly useful for crosscompiling and embedded systems. + +include(Internal/CMakeCommonLinkerInformation) + +set(_INCLUDED_FILE 0) + +# Load linker-specific information. +if(CMAKE_Swoft_COMPILER_LINKER_ID) + include(Linker/${CMAKE_Swift_COMPILER_LINKER_ID}-Swift OPTIONAL) +endif() + +# load a hardware specific file, mostly useful for embedded compilers +if(CMAKE_SYSTEM_PROCESSOR AND CMAKE_Swift_COMPILER_LINKER_ID) + include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_LINKER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + + +# load the system- and linker specific files +if(CMAKE_Swift_COMPILER_LINKER_ID) + include(Platform/Linker/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_LINKER_ID}-Swift + OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) +endif() + +# We specify the platform linker information in the system file. +if (NOT _INCLUDED_FILE) + include(Platform/Linker/${CMAKE_SYSTEM_NAME}-Swift OPTIONAL) +endif () + +_cmake_common_linker_platform_flags(Swift) + +set(CMAKE_Swift_LINKER_INFORMATION_LOADED 1) diff --git a/Modules/Linker/AIX-ASM.cmake b/Modules/Linker/AIX-ASM.cmake new file mode 100644 index 0000000000..0c748fc40d --- /dev/null +++ b/Modules/Linker/AIX-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/AIX) + +__linker_aix(ASM) diff --git a/Modules/Linker/AIX-C.cmake b/Modules/Linker/AIX-C.cmake new file mode 100644 index 0000000000..c1bfd45322 --- /dev/null +++ b/Modules/Linker/AIX-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/AIX) + +__linker_aix(C) diff --git a/Modules/Linker/AIX-CXX.cmake b/Modules/Linker/AIX-CXX.cmake new file mode 100644 index 0000000000..34cdf20c8f --- /dev/null +++ b/Modules/Linker/AIX-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/AIX) + +__linker_aix(CXX) diff --git a/Modules/Linker/AIX-Fortran.cmake b/Modules/Linker/AIX-Fortran.cmake new file mode 100644 index 0000000000..cf74076186 --- /dev/null +++ b/Modules/Linker/AIX-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/AIX) + +__linker_aix(Fortran) diff --git a/Modules/Linker/AIX.cmake b/Modules/Linker/AIX.cmake new file mode 100644 index 0000000000..6639df3ac3 --- /dev/null +++ b/Modules/Linker/AIX.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple linkers; use include blocker. +include_guard() + +macro(__linker_aix lang) +endmacro() diff --git a/Modules/Linker/AppleClang-ASM.cmake b/Modules/Linker/AppleClang-ASM.cmake new file mode 100644 index 0000000000..9f160d9070 --- /dev/null +++ b/Modules/Linker/AppleClang-ASM.cmake @@ -0,0 +1,3 @@ +include(Linker/AppleClang) + +__linker_appleclang(ASM) diff --git a/Modules/Linker/AppleClang-C.cmake b/Modules/Linker/AppleClang-C.cmake new file mode 100644 index 0000000000..0a98f2945a --- /dev/null +++ b/Modules/Linker/AppleClang-C.cmake @@ -0,0 +1,3 @@ +include(Linker/AppleClang) + +__linker_appleclang(C) diff --git a/Modules/Linker/AppleClang-CXX.cmake b/Modules/Linker/AppleClang-CXX.cmake new file mode 100644 index 0000000000..09d7ab6e27 --- /dev/null +++ b/Modules/Linker/AppleClang-CXX.cmake @@ -0,0 +1,3 @@ +include(Linker/AppleClang) + +__linker_appleclang(CXX) diff --git a/Modules/Linker/AppleClang-OBJC.cmake b/Modules/Linker/AppleClang-OBJC.cmake new file mode 100644 index 0000000000..73cd914301 --- /dev/null +++ b/Modules/Linker/AppleClang-OBJC.cmake @@ -0,0 +1,3 @@ +include(Linker/AppleClang) + +__linker_appleclang(OBJC) diff --git a/Modules/Linker/AppleClang-OBJCXX.cmake b/Modules/Linker/AppleClang-OBJCXX.cmake new file mode 100644 index 0000000000..211e28a878 --- /dev/null +++ b/Modules/Linker/AppleClang-OBJCXX.cmake @@ -0,0 +1,3 @@ +include(Linker/AppleClang) + +__linker_appleclang(OBJCXX) diff --git a/Modules/Linker/AppleClang.cmake b/Modules/Linker/AppleClang.cmake new file mode 100644 index 0000000000..4e4899817a --- /dev/null +++ b/Modules/Linker/AppleClang.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple linkers; use include blocker. + +include_guard() + +macro(__linker_appleclang lang) +endmacro() diff --git a/Modules/Linker/GNU-ASM.cmake b/Modules/Linker/GNU-ASM.cmake new file mode 100644 index 0000000000..d927106db6 --- /dev/null +++ b/Modules/Linker/GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(ASM) diff --git a/Modules/Linker/GNU-C.cmake b/Modules/Linker/GNU-C.cmake new file mode 100644 index 0000000000..9a19e7d033 --- /dev/null +++ b/Modules/Linker/GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(C) diff --git a/Modules/Linker/GNU-CUDA.cmake b/Modules/Linker/GNU-CUDA.cmake new file mode 100644 index 0000000000..82e887fe93 --- /dev/null +++ b/Modules/Linker/GNU-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(CUDA) diff --git a/Modules/Linker/GNU-CXX.cmake b/Modules/Linker/GNU-CXX.cmake new file mode 100644 index 0000000000..6b4d719409 --- /dev/null +++ b/Modules/Linker/GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(CXX) diff --git a/Modules/Linker/GNU-Fortran.cmake b/Modules/Linker/GNU-Fortran.cmake new file mode 100644 index 0000000000..b4f688aaca --- /dev/null +++ b/Modules/Linker/GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(Fortran) diff --git a/Modules/Linker/GNU-HIP.cmake b/Modules/Linker/GNU-HIP.cmake new file mode 100644 index 0000000000..b2d0b2e165 --- /dev/null +++ b/Modules/Linker/GNU-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(HIP) diff --git a/Modules/Linker/GNU.cmake b/Modules/Linker/GNU.cmake new file mode 100644 index 0000000000..cfb630f4e4 --- /dev/null +++ b/Modules/Linker/GNU.cmake @@ -0,0 +1,67 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple linkers; use include blocker. +include_guard() + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +macro(__linker_gnu lang) + # define flags for linker depfile generation + set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,") + set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc) + + block(SCOPE_FOR VARIABLES + PROPAGATE CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED + CMAKE_${lang}_LINK_DEPENDS_USE_LINKER) + if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) + ## Ensure ninja tool is recent enough... + if(CMAKE_GENERATOR MATCHES "^Ninja") + # Ninja 1.10 or upper is required + execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version + OUTPUT_VARIABLE _ninja_version + ERROR_VARIABLE _ninja_version) + if (_ninja_version MATCHES "[0-9]+(\\.[0-9]+)*") + set (_ninja_version "${CMAKE_MATCH_0}") + endif() + if (_ninja_version VERSION_LESS "1.10") + set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) + endif() + endif() + + if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) + ## check if this feature is supported by the linker + if (CMAKE_${lang}_COMPILER_LINKER AND CMAKE_${lang}_COMPILER_LINKER_ID MATCHES "GNU|LLD") + execute_process(COMMAND "${CMAKE_${lang}_COMPILER_LINKER}" --help + OUTPUT_VARIABLE _linker_capabilities + ERROR_VARIABLE _linker_capabilities) + if(_linker_capabilities MATCHES "--dependency-file") + set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED TRUE) + else() + set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) + endif() + else() + set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE) + endif() + endif() + endif() + if (CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) + set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER TRUE) + else() + set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) + endif() + + # Due to GNU binutils ld bug when LTO is enabled (see GNU bug + # `30568 `_), + # deactivate this feature if the version is less than 2.41. + if (CMAKE_${lang}_COMPILER_LINKER_ID + AND CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNU" + AND CMAKE_${lang}_COMPILER_LINKER_VERSION VERSION_LESS "2.41") + set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) + endif() + endblock() +endmacro() + +endblock() diff --git a/Modules/Linker/GNUgold-ASM.cmake b/Modules/Linker/GNUgold-ASM.cmake new file mode 100644 index 0000000000..9f920e52c4 --- /dev/null +++ b/Modules/Linker/GNUgold-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(ASM) diff --git a/Modules/Linker/GNUgold-C.cmake b/Modules/Linker/GNUgold-C.cmake new file mode 100644 index 0000000000..a510626bc0 --- /dev/null +++ b/Modules/Linker/GNUgold-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(C) diff --git a/Modules/Linker/GNUgold-CUDA.cmake b/Modules/Linker/GNUgold-CUDA.cmake new file mode 100644 index 0000000000..9cd52e0402 --- /dev/null +++ b/Modules/Linker/GNUgold-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(CUDA) diff --git a/Modules/Linker/GNUgold-CXX.cmake b/Modules/Linker/GNUgold-CXX.cmake new file mode 100644 index 0000000000..eeb624b0dc --- /dev/null +++ b/Modules/Linker/GNUgold-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(CXX) diff --git a/Modules/Linker/GNUgold-Fortran.cmake b/Modules/Linker/GNUgold-Fortran.cmake new file mode 100644 index 0000000000..97298eddbf --- /dev/null +++ b/Modules/Linker/GNUgold-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(Fortran) diff --git a/Modules/Linker/GNUgold-HIP.cmake b/Modules/Linker/GNUgold-HIP.cmake new file mode 100644 index 0000000000..900b9aa05a --- /dev/null +++ b/Modules/Linker/GNUgold-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNUgold) + +__linker_gnugold(HIP) diff --git a/Modules/Linker/GNUgold.cmake b/Modules/Linker/GNUgold.cmake new file mode 100644 index 0000000000..4680564880 --- /dev/null +++ b/Modules/Linker/GNUgold.cmake @@ -0,0 +1,18 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple linkers; use include blocker. +include_guard() + +include(Linker/GNU) + +macro(__linker_gnugold lang) + __linker_gnu(${lang}) + + # Due to GNU binutils ld bug when LTO is enabled (see GNU bug + # `30568 `_), + # deactivate this feature because all known versions of gold linker have + # this bug. + set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) +endmacro() diff --git a/Modules/Linker/LLD-ASM.cmake b/Modules/Linker/LLD-ASM.cmake new file mode 100644 index 0000000000..255f8c5cce --- /dev/null +++ b/Modules/Linker/LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(ASM) diff --git a/Modules/Linker/LLD-C.cmake b/Modules/Linker/LLD-C.cmake new file mode 100644 index 0000000000..d3036b0d42 --- /dev/null +++ b/Modules/Linker/LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(C) diff --git a/Modules/Linker/LLD-CUDA.cmake b/Modules/Linker/LLD-CUDA.cmake new file mode 100644 index 0000000000..aa72413122 --- /dev/null +++ b/Modules/Linker/LLD-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(CUDA) diff --git a/Modules/Linker/LLD-CXX.cmake b/Modules/Linker/LLD-CXX.cmake new file mode 100644 index 0000000000..0a0d2de35b --- /dev/null +++ b/Modules/Linker/LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(CXX) diff --git a/Modules/Linker/LLD-Fortran.cmake b/Modules/Linker/LLD-Fortran.cmake new file mode 100644 index 0000000000..babcd9a053 --- /dev/null +++ b/Modules/Linker/LLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(Fortran) diff --git a/Modules/Linker/LLD-HIP.cmake b/Modules/Linker/LLD-HIP.cmake new file mode 100644 index 0000000000..8535830b36 --- /dev/null +++ b/Modules/Linker/LLD-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(HIP) diff --git a/Modules/Linker/LLD-OBJC.cmake b/Modules/Linker/LLD-OBJC.cmake new file mode 100644 index 0000000000..7a2af76706 --- /dev/null +++ b/Modules/Linker/LLD-OBJC.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(OBJC) diff --git a/Modules/Linker/LLD-OBJCXX.cmake b/Modules/Linker/LLD-OBJCXX.cmake new file mode 100644 index 0000000000..2361e90373 --- /dev/null +++ b/Modules/Linker/LLD-OBJCXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/LLD) + +__linker_lld(OBJCXX) diff --git a/Modules/Linker/LLD.cmake b/Modules/Linker/LLD.cmake new file mode 100644 index 0000000000..6695f983f0 --- /dev/null +++ b/Modules/Linker/LLD.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include_guard() + +include(Linker/GNU) + +macro(__linker_lld lang) + __linker_gnu(${lang}) +endmacro() diff --git a/Modules/Linker/MOLD-ASM.cmake b/Modules/Linker/MOLD-ASM.cmake new file mode 100644 index 0000000000..d927106db6 --- /dev/null +++ b/Modules/Linker/MOLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(ASM) diff --git a/Modules/Linker/MOLD-C.cmake b/Modules/Linker/MOLD-C.cmake new file mode 100644 index 0000000000..9a19e7d033 --- /dev/null +++ b/Modules/Linker/MOLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(C) diff --git a/Modules/Linker/MOLD-CUDA.cmake b/Modules/Linker/MOLD-CUDA.cmake new file mode 100644 index 0000000000..82e887fe93 --- /dev/null +++ b/Modules/Linker/MOLD-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(CUDA) diff --git a/Modules/Linker/MOLD-CXX.cmake b/Modules/Linker/MOLD-CXX.cmake new file mode 100644 index 0000000000..6b4d719409 --- /dev/null +++ b/Modules/Linker/MOLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(CXX) diff --git a/Modules/Linker/MOLD-Fortran.cmake b/Modules/Linker/MOLD-Fortran.cmake new file mode 100644 index 0000000000..b4f688aaca --- /dev/null +++ b/Modules/Linker/MOLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(Fortran) diff --git a/Modules/Linker/MOLD-HIP.cmake b/Modules/Linker/MOLD-HIP.cmake new file mode 100644 index 0000000000..b2d0b2e165 --- /dev/null +++ b/Modules/Linker/MOLD-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(HIP) diff --git a/Modules/Linker/MOLD-OBJC.cmake b/Modules/Linker/MOLD-OBJC.cmake new file mode 100644 index 0000000000..a3c668d816 --- /dev/null +++ b/Modules/Linker/MOLD-OBJC.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(OBJC) diff --git a/Modules/Linker/MOLD-OBJCXX.cmake b/Modules/Linker/MOLD-OBJCXX.cmake new file mode 100644 index 0000000000..0b7300363e --- /dev/null +++ b/Modules/Linker/MOLD-OBJCXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/GNU) + +__linker_gnu(OBJCXX) diff --git a/Modules/Linker/Solaris-ASM.cmake b/Modules/Linker/Solaris-ASM.cmake new file mode 100644 index 0000000000..2bcdd71e79 --- /dev/null +++ b/Modules/Linker/Solaris-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/Solaris) + +__linker_solaris(ASM) diff --git a/Modules/Linker/Solaris-C.cmake b/Modules/Linker/Solaris-C.cmake new file mode 100644 index 0000000000..23458d5325 --- /dev/null +++ b/Modules/Linker/Solaris-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/Solaris) + +__linker_solaris(C) diff --git a/Modules/Linker/Solaris-CXX.cmake b/Modules/Linker/Solaris-CXX.cmake new file mode 100644 index 0000000000..8ddf9099b3 --- /dev/null +++ b/Modules/Linker/Solaris-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/Solaris) + +__linker_solaris(CXX) diff --git a/Modules/Linker/Solaris-Fortran.cmake b/Modules/Linker/Solaris-Fortran.cmake new file mode 100644 index 0000000000..111cf11fdf --- /dev/null +++ b/Modules/Linker/Solaris-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Linker/Solaris) + +__linker_solaris(Fortran) diff --git a/Modules/Linker/Solaris.cmake b/Modules/Linker/Solaris.cmake new file mode 100644 index 0000000000..fbd11996a9 --- /dev/null +++ b/Modules/Linker/Solaris.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple linkers; use include blocker. +include_guard() + +macro(__linker_solaris lang) +endmacro() diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 093efa1f1f..c9f01a6b48 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -17,7 +17,6 @@ macro(__aix_compiler_gnu lang) set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v") set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") - set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1) unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY) diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 485f31e112..f7cab254e6 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -17,7 +17,6 @@ macro(__aix_compiler_xl lang) set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath") - set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) set(_OBJECTS " ") if(DEFINED CMAKE_XL_CreateExportList AND CMAKE_XL_CreateExportList STREQUAL "") diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index bdba36309d..83357a7e28 100644 --- a/Modules/Platform/Apple-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -15,8 +15,6 @@ macro(__apple_compiler_clang lang) set(CMAKE_${lang}_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ") endif() - set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) - set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK "-framework ") set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK_SUPPORTED TRUE) set(CMAKE_${lang}_LINK_LIBRARY_FRAMEWORK_ATTRIBUTES LIBRARY_TYPE=STATIC,SHARED DEDUPLICATION=DEFAULT OVERRIDE=DEFAULT) diff --git a/Modules/Platform/Linker/AIX-AIX-ASM.cmake b/Modules/Platform/Linker/AIX-AIX-ASM.cmake new file mode 100644 index 0000000000..714e6a83b2 --- /dev/null +++ b/Modules/Platform/Linker/AIX-AIX-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/AIX-AIX) + +__aix_linker_aix(ASM) diff --git a/Modules/Platform/Linker/AIX-AIX-C.cmake b/Modules/Platform/Linker/AIX-AIX-C.cmake new file mode 100644 index 0000000000..4cd4b9c5b3 --- /dev/null +++ b/Modules/Platform/Linker/AIX-AIX-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/AIX-AIX) + +__aix_linker_aix(C) diff --git a/Modules/Platform/Linker/AIX-AIX-CXX.cmake b/Modules/Platform/Linker/AIX-AIX-CXX.cmake new file mode 100644 index 0000000000..4c6f917f67 --- /dev/null +++ b/Modules/Platform/Linker/AIX-AIX-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/AIX-AIX) + +__aix_linker_aix(CXX) diff --git a/Modules/Platform/Linker/AIX-AIX-Fortran.cmake b/Modules/Platform/Linker/AIX-AIX-Fortran.cmake new file mode 100644 index 0000000000..c7a43c5cab --- /dev/null +++ b/Modules/Platform/Linker/AIX-AIX-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/AIX-AIX) + +__aix_linker_aix(Fortran) diff --git a/Modules/Platform/Linker/AIX-AIX.cmake b/Modules/Platform/Linker/AIX-AIX.cmake new file mode 100644 index 0000000000..36d7959364 --- /dev/null +++ b/Modules/Platform/Linker/AIX-AIX.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__aix_linker_aix lang) + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/AIX-ASM.cmake b/Modules/Platform/Linker/AIX-ASM.cmake new file mode 100644 index 0000000000..6699054fc6 --- /dev/null +++ b/Modules/Platform/Linker/AIX-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AIX is the default linker +include(Platform/Linker/AIX-AIX-ASM) diff --git a/Modules/Platform/Linker/AIX-C.cmake b/Modules/Platform/Linker/AIX-C.cmake new file mode 100644 index 0000000000..5eae8d91ae --- /dev/null +++ b/Modules/Platform/Linker/AIX-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AIX is the default linker +include(Platform/Linker/AIX-AIX-C) diff --git a/Modules/Platform/Linker/AIX-CXX.cmake b/Modules/Platform/Linker/AIX-CXX.cmake new file mode 100644 index 0000000000..bd770118e7 --- /dev/null +++ b/Modules/Platform/Linker/AIX-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AIX is the default linker +include(Platform/Linker/AIX-AIX-CXX) diff --git a/Modules/Platform/Linker/AIX-Fortran.cmake b/Modules/Platform/Linker/AIX-Fortran.cmake new file mode 100644 index 0000000000..182af9b23b --- /dev/null +++ b/Modules/Platform/Linker/AIX-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AIX is the default linker +include(Platform/Linker/AIX-AIX-Fortran) diff --git a/Modules/Platform/Linker/Apple-ASM.cmake b/Modules/Platform/Linker/Apple-ASM.cmake new file mode 100644 index 0000000000..8dc768405b --- /dev/null +++ b/Modules/Platform/Linker/Apple-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-ASM) diff --git a/Modules/Platform/Linker/Apple-AppleClang-ASM.cmake b/Modules/Platform/Linker/Apple-AppleClang-ASM.cmake new file mode 100644 index 0000000000..9cf9ff2d67 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(ASM) diff --git a/Modules/Platform/Linker/Apple-AppleClang-C.cmake b/Modules/Platform/Linker/Apple-AppleClang-C.cmake new file mode 100644 index 0000000000..5333074d8a --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(C) diff --git a/Modules/Platform/Linker/Apple-AppleClang-CUDA.cmake b/Modules/Platform/Linker/Apple-AppleClang-CUDA.cmake new file mode 100644 index 0000000000..87fa306191 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(CUDA) diff --git a/Modules/Platform/Linker/Apple-AppleClang-CXX.cmake b/Modules/Platform/Linker/Apple-AppleClang-CXX.cmake new file mode 100644 index 0000000000..d414824ff6 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(CXX) diff --git a/Modules/Platform/Linker/Apple-AppleClang-Fortran.cmake b/Modules/Platform/Linker/Apple-AppleClang-Fortran.cmake new file mode 100644 index 0000000000..5637f0fec7 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(Fortran) diff --git a/Modules/Platform/Linker/Apple-AppleClang-OBJC.cmake b/Modules/Platform/Linker/Apple-AppleClang-OBJC.cmake new file mode 100644 index 0000000000..4e39bddb02 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-OBJC.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(OBJC) diff --git a/Modules/Platform/Linker/Apple-AppleClang-OBJCXX.cmake b/Modules/Platform/Linker/Apple-AppleClang-OBJCXX.cmake new file mode 100644 index 0000000000..27791970a1 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang-OBJCXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang) + +__apple_linker_appleclang(OBJCXX) diff --git a/Modules/Platform/Linker/Apple-AppleClang.cmake b/Modules/Platform/Linker/Apple-AppleClang.cmake new file mode 100644 index 0000000000..71376e7125 --- /dev/null +++ b/Modules/Platform/Linker/Apple-AppleClang.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__apple_linker_appleclang lang) + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/Apple-C.cmake b/Modules/Platform/Linker/Apple-C.cmake new file mode 100644 index 0000000000..02a1da90e7 --- /dev/null +++ b/Modules/Platform/Linker/Apple-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-C) diff --git a/Modules/Platform/Linker/Apple-CUDA.cmake b/Modules/Platform/Linker/Apple-CUDA.cmake new file mode 100644 index 0000000000..27b466d988 --- /dev/null +++ b/Modules/Platform/Linker/Apple-CUDA.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-CUDA) diff --git a/Modules/Platform/Linker/Apple-CXX.cmake b/Modules/Platform/Linker/Apple-CXX.cmake new file mode 100644 index 0000000000..b2bc90b3df --- /dev/null +++ b/Modules/Platform/Linker/Apple-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-CXX) diff --git a/Modules/Platform/Linker/Apple-Fortran.cmake b/Modules/Platform/Linker/Apple-Fortran.cmake new file mode 100644 index 0000000000..a39e7aee3b --- /dev/null +++ b/Modules/Platform/Linker/Apple-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-Fortran) diff --git a/Modules/Platform/Linker/Apple-LLD-C.cmake b/Modules/Platform/Linker/Apple-LLD-C.cmake new file mode 100644 index 0000000000..e38b1b7e8c --- /dev/null +++ b/Modules/Platform/Linker/Apple-LLD-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-C) diff --git a/Modules/Platform/Linker/Apple-LLD-CXX.cmake b/Modules/Platform/Linker/Apple-LLD-CXX.cmake new file mode 100644 index 0000000000..4e4a9cad1f --- /dev/null +++ b/Modules/Platform/Linker/Apple-LLD-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-CXX) diff --git a/Modules/Platform/Linker/Apple-LLD-OBJC.cmake b/Modules/Platform/Linker/Apple-LLD-OBJC.cmake new file mode 100644 index 0000000000..ff18785a10 --- /dev/null +++ b/Modules/Platform/Linker/Apple-LLD-OBJC.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-OBJC) diff --git a/Modules/Platform/Linker/Apple-LLD-OBJCXX.cmake b/Modules/Platform/Linker/Apple-LLD-OBJCXX.cmake new file mode 100644 index 0000000000..ba92890257 --- /dev/null +++ b/Modules/Platform/Linker/Apple-LLD-OBJCXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-OBJCXX) diff --git a/Modules/Platform/Linker/Apple-MOLD-C.cmake b/Modules/Platform/Linker/Apple-MOLD-C.cmake new file mode 100644 index 0000000000..e38b1b7e8c --- /dev/null +++ b/Modules/Platform/Linker/Apple-MOLD-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-C) diff --git a/Modules/Platform/Linker/Apple-MOLD-CXX.cmake b/Modules/Platform/Linker/Apple-MOLD-CXX.cmake new file mode 100644 index 0000000000..4e4a9cad1f --- /dev/null +++ b/Modules/Platform/Linker/Apple-MOLD-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-CXX) diff --git a/Modules/Platform/Linker/Apple-MOLD-OBJC.cmake b/Modules/Platform/Linker/Apple-MOLD-OBJC.cmake new file mode 100644 index 0000000000..ff18785a10 --- /dev/null +++ b/Modules/Platform/Linker/Apple-MOLD-OBJC.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-OBJC) diff --git a/Modules/Platform/Linker/Apple-MOLD-OBJCXX.cmake b/Modules/Platform/Linker/Apple-MOLD-OBJCXX.cmake new file mode 100644 index 0000000000..ba92890257 --- /dev/null +++ b/Modules/Platform/Linker/Apple-MOLD-OBJCXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Apple-AppleClang-OBJCXX) diff --git a/Modules/Platform/Linker/Apple-OBJC.cmake b/Modules/Platform/Linker/Apple-OBJC.cmake new file mode 100644 index 0000000000..316d25313f --- /dev/null +++ b/Modules/Platform/Linker/Apple-OBJC.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-OBJC) diff --git a/Modules/Platform/Linker/Apple-OBJCXX.cmake b/Modules/Platform/Linker/Apple-OBJCXX.cmake new file mode 100644 index 0000000000..23db50fee9 --- /dev/null +++ b/Modules/Platform/Linker/Apple-OBJCXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# AppleClang is the default linker +include(Platform/Linker/Apple-AppleClang-OBJCXX) diff --git a/Modules/Platform/Linker/BSD-Linker-Initialize.cmake b/Modules/Platform/Linker/BSD-Linker-Initialize.cmake new file mode 100644 index 0000000000..3de1dabb66 --- /dev/null +++ b/Modules/Platform/Linker/BSD-Linker-Initialize.cmake @@ -0,0 +1,22 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(NOT _CMAKE_SYSTEM_LINKER_TYPE) + block(SCOPE_FOR VARIABLES) + execute_process(COMMAND "${CMAKE_LINKER}" --version + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output) + if(result OR NOT output MATCHES "LLD") + # assume GNU as default linker + set(_CMAKE_SYSTEM_LINKER_TYPE GNU CACHE INTERNAL "System linker type") + else() + set(_CMAKE_SYSTEM_LINKER_TYPE LLD CACHE INTERNAL "System linker type") + endif() + endblock() +endif() + +endblock() diff --git a/Modules/Platform/Linker/CYGWIN-ASM.cmake b/Modules/Platform/Linker/CYGWIN-ASM.cmake new file mode 100644 index 0000000000..ab95f4cebd --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/CYGWIN-GNU-ASM) diff --git a/Modules/Platform/Linker/CYGWIN-C.cmake b/Modules/Platform/Linker/CYGWIN-C.cmake new file mode 100644 index 0000000000..703624df32 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/CYGWIN-GNU-C) diff --git a/Modules/Platform/Linker/CYGWIN-CXX.cmake b/Modules/Platform/Linker/CYGWIN-CXX.cmake new file mode 100644 index 0000000000..783718804c --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/CYGWIN-GNU-CXX) diff --git a/Modules/Platform/Linker/CYGWIN-Fortran.cmake b/Modules/Platform/Linker/CYGWIN-Fortran.cmake new file mode 100644 index 0000000000..18ce085f45 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/CYGWIN-GNU-Fortran) diff --git a/Modules/Platform/Linker/CYGWIN-GNU-ASM.cmake b/Modules/Platform/Linker/CYGWIN-GNU-ASM.cmake new file mode 100644 index 0000000000..e65d0a07ca --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU) + +__cygwin_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/CYGWIN-GNU-C.cmake b/Modules/Platform/Linker/CYGWIN-GNU-C.cmake new file mode 100644 index 0000000000..dc0a678d5e --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU) + +__cygwin_linker_gnu(C) diff --git a/Modules/Platform/Linker/CYGWIN-GNU-CXX.cmake b/Modules/Platform/Linker/CYGWIN-GNU-CXX.cmake new file mode 100644 index 0000000000..a45b3cd6f5 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU) + +__cygwin_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/CYGWIN-GNU-Fortran.cmake b/Modules/Platform/Linker/CYGWIN-GNU-Fortran.cmake new file mode 100644 index 0000000000..7eba12a58c --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU) + +__cygwin_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/CYGWIN-GNU.cmake b/Modules/Platform/Linker/CYGWIN-GNU.cmake new file mode 100644 index 0000000000..538f611e15 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__cygwin_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/CYGWIN-LLD-ASM.cmake b/Modules/Platform/Linker/CYGWIN-LLD-ASM.cmake new file mode 100644 index 0000000000..1c65875fef --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD) + +__cygwin_linker_lld(ASM) diff --git a/Modules/Platform/Linker/CYGWIN-LLD-C.cmake b/Modules/Platform/Linker/CYGWIN-LLD-C.cmake new file mode 100644 index 0000000000..a4f3063bb9 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD) + +__cygwin_linker_lld(C) diff --git a/Modules/Platform/Linker/CYGWIN-LLD-CXX.cmake b/Modules/Platform/Linker/CYGWIN-LLD-CXX.cmake new file mode 100644 index 0000000000..5bd50632a6 --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD) + +__cygwin_linker_lld(CXX) diff --git a/Modules/Platform/Linker/CYGWIN-LLD-Fortran.cmake b/Modules/Platform/Linker/CYGWIN-LLD-Fortran.cmake new file mode 100644 index 0000000000..3034b186da --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-LLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD) + +__cygwin_linker_lld(Fortran) diff --git a/Modules/Platform/Linker/CYGWIN-LLD.cmake b/Modules/Platform/Linker/CYGWIN-LLD.cmake new file mode 100644 index 0000000000..39a3c594ab --- /dev/null +++ b/Modules/Platform/Linker/CYGWIN-LLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/CYGWIN-GNU) + + +macro(__cygwin_linker_lld lang) + __cygwin_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/DragonFly-ASM.cmake b/Modules/Platform/Linker/DragonFly-ASM.cmake new file mode 100644 index 0000000000..b0464889cf --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-ASM) diff --git a/Modules/Platform/Linker/DragonFly-C.cmake b/Modules/Platform/Linker/DragonFly-C.cmake new file mode 100644 index 0000000000..6fedac2bff --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-C) diff --git a/Modules/Platform/Linker/DragonFly-CXX.cmake b/Modules/Platform/Linker/DragonFly-CXX.cmake new file mode 100644 index 0000000000..8064bf4999 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-CXX) diff --git a/Modules/Platform/Linker/DragonFly-Fortran.cmake b/Modules/Platform/Linker/DragonFly-Fortran.cmake new file mode 100644 index 0000000000..64ea904787 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-Fortran) diff --git a/Modules/Platform/Linker/DragonFly-GNU-ASM.cmake b/Modules/Platform/Linker/DragonFly-GNU-ASM.cmake new file mode 100644 index 0000000000..e643a97155 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-GNU-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU-ASM) diff --git a/Modules/Platform/Linker/DragonFly-GNU-C.cmake b/Modules/Platform/Linker/DragonFly-GNU-C.cmake new file mode 100644 index 0000000000..729e68d422 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-GNU-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU-C) diff --git a/Modules/Platform/Linker/DragonFly-GNU-CXX.cmake b/Modules/Platform/Linker/DragonFly-GNU-CXX.cmake new file mode 100644 index 0000000000..d9907ae203 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-GNU-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU-CXX) diff --git a/Modules/Platform/Linker/DragonFly-GNU-Fortran.cmake b/Modules/Platform/Linker/DragonFly-GNU-Fortran.cmake new file mode 100644 index 0000000000..f696be9ceb --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-GNU-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU-Fortran) diff --git a/Modules/Platform/Linker/DragonFly-LLD-ASM.cmake b/Modules/Platform/Linker/DragonFly-LLD-ASM.cmake new file mode 100644 index 0000000000..d4774cd2bc --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-LLD-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD-ASM) diff --git a/Modules/Platform/Linker/DragonFly-LLD-C.cmake b/Modules/Platform/Linker/DragonFly-LLD-C.cmake new file mode 100644 index 0000000000..5ec3b76de8 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-LLD-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD-C) diff --git a/Modules/Platform/Linker/DragonFly-LLD-CXX.cmake b/Modules/Platform/Linker/DragonFly-LLD-CXX.cmake new file mode 100644 index 0000000000..11ab59e343 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-LLD-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD-CXX) diff --git a/Modules/Platform/Linker/DragonFly-LLD-Fortran.cmake b/Modules/Platform/Linker/DragonFly-LLD-Fortran.cmake new file mode 100644 index 0000000000..a2b51410c7 --- /dev/null +++ b/Modules/Platform/Linker/DragonFly-LLD-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD-Fortran) diff --git a/Modules/Platform/Linker/FreeBSD-ASM.cmake b/Modules/Platform/Linker/FreeBSD-ASM.cmake new file mode 100644 index 0000000000..d8c8c863d5 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-ASM.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/FreeBSD-GNU-ASM) +else() + include(Platform/Linker/FreeBSD-LLD-ASM) +endif() + +endblock() diff --git a/Modules/Platform/Linker/FreeBSD-C.cmake b/Modules/Platform/Linker/FreeBSD-C.cmake new file mode 100644 index 0000000000..09975ad50f --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-C.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/FreeBSD-GNU-C) +else() + include(Platform/Linker/FreeBSD-LLD-C) +endif() + +endblock() diff --git a/Modules/Platform/Linker/FreeBSD-CXX.cmake b/Modules/Platform/Linker/FreeBSD-CXX.cmake new file mode 100644 index 0000000000..9dcb17a618 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-CXX.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/FreeBSD-GNU-CXX) +else() + include(Platform/Linker/FreeBSD-LLD-CXX) +endif() + +endblock() diff --git a/Modules/Platform/Linker/FreeBSD-Fortran.cmake b/Modules/Platform/Linker/FreeBSD-Fortran.cmake new file mode 100644 index 0000000000..793e0a6a0e --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-Fortran.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/FreeBSD-GNU-Fortran) +else() + include(Platform/Linker/FreeBSD-LLD-Fortran) +endif() + +endblock() diff --git a/Modules/Platform/Linker/FreeBSD-GNU-ASM.cmake b/Modules/Platform/Linker/FreeBSD-GNU-ASM.cmake new file mode 100644 index 0000000000..5ff8ed8aec --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU) + +__freebsd_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/FreeBSD-GNU-C.cmake b/Modules/Platform/Linker/FreeBSD-GNU-C.cmake new file mode 100644 index 0000000000..8b6f0fd464 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU) + +__freebsd_linker_gnu(C) diff --git a/Modules/Platform/Linker/FreeBSD-GNU-CXX.cmake b/Modules/Platform/Linker/FreeBSD-GNU-CXX.cmake new file mode 100644 index 0000000000..ecc5533640 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU) + +__freebsd_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/FreeBSD-GNU-Fortran.cmake b/Modules/Platform/Linker/FreeBSD-GNU-Fortran.cmake new file mode 100644 index 0000000000..0e20437196 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-GNU) + +__freebsd_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/FreeBSD-GNU.cmake b/Modules/Platform/Linker/FreeBSD-GNU.cmake new file mode 100644 index 0000000000..82f41fc195 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__freebsd_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/FreeBSD-LLD-ASM.cmake b/Modules/Platform/Linker/FreeBSD-LLD-ASM.cmake new file mode 100644 index 0000000000..0b362988ff --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD) + +__freebsd_linker_lld(ASM) diff --git a/Modules/Platform/Linker/FreeBSD-LLD-C.cmake b/Modules/Platform/Linker/FreeBSD-LLD-C.cmake new file mode 100644 index 0000000000..0120daca77 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD) + +__freebsd_linker_lld(C) diff --git a/Modules/Platform/Linker/FreeBSD-LLD-CXX.cmake b/Modules/Platform/Linker/FreeBSD-LLD-CXX.cmake new file mode 100644 index 0000000000..0d8aea8673 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD) + +__freebsd_linker_lld(CXX) diff --git a/Modules/Platform/Linker/FreeBSD-LLD-Fortran.cmake b/Modules/Platform/Linker/FreeBSD-LLD-Fortran.cmake new file mode 100644 index 0000000000..fa0991d146 --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-LLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/FreeBSD-LLD) + +__freebsd_linker_lld(Fortran) diff --git a/Modules/Platform/Linker/FreeBSD-LLD.cmake b/Modules/Platform/Linker/FreeBSD-LLD.cmake new file mode 100644 index 0000000000..133f80c5de --- /dev/null +++ b/Modules/Platform/Linker/FreeBSD-LLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/FreeBSD-GNU) + + +macro(__freebsd_linker_lld lang) + __freebsd_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/GNU-ASM.cmake b/Modules/Platform/Linker/GNU-ASM.cmake new file mode 100644 index 0000000000..e78201cae3 --- /dev/null +++ b/Modules/Platform/Linker/GNU-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/GNU-GNU-ASM) diff --git a/Modules/Platform/Linker/GNU-C.cmake b/Modules/Platform/Linker/GNU-C.cmake new file mode 100644 index 0000000000..76679409bb --- /dev/null +++ b/Modules/Platform/Linker/GNU-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/GNU-GNU-C) diff --git a/Modules/Platform/Linker/GNU-CXX.cmake b/Modules/Platform/Linker/GNU-CXX.cmake new file mode 100644 index 0000000000..d653f34e0c --- /dev/null +++ b/Modules/Platform/Linker/GNU-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/GNU-GNU-CXX) diff --git a/Modules/Platform/Linker/GNU-Fortran.cmake b/Modules/Platform/Linker/GNU-Fortran.cmake new file mode 100644 index 0000000000..99bcb76f15 --- /dev/null +++ b/Modules/Platform/Linker/GNU-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/GNU-GNU-Fortran) diff --git a/Modules/Platform/Linker/GNU-GNU-ASM.cmake b/Modules/Platform/Linker/GNU-GNU-ASM.cmake new file mode 100644 index 0000000000..39316b9d9b --- /dev/null +++ b/Modules/Platform/Linker/GNU-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/GNU-GNU) + +__gnu_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/GNU-GNU-C.cmake b/Modules/Platform/Linker/GNU-GNU-C.cmake new file mode 100644 index 0000000000..12a9883c81 --- /dev/null +++ b/Modules/Platform/Linker/GNU-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/GNU-GNU) + +__gnu_linker_gnu(C) diff --git a/Modules/Platform/Linker/GNU-GNU-CXX.cmake b/Modules/Platform/Linker/GNU-GNU-CXX.cmake new file mode 100644 index 0000000000..776f604d7a --- /dev/null +++ b/Modules/Platform/Linker/GNU-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/GNU-GNU) + +__gnu_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/GNU-GNU-Fortran.cmake b/Modules/Platform/Linker/GNU-GNU-Fortran.cmake new file mode 100644 index 0000000000..87b5c9b0c9 --- /dev/null +++ b/Modules/Platform/Linker/GNU-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/GNU-GNU) + +__gnu_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/GNU-GNU.cmake b/Modules/Platform/Linker/GNU-GNU.cmake new file mode 100644 index 0000000000..f04e911c4b --- /dev/null +++ b/Modules/Platform/Linker/GNU-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__gnu_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/Linux-ASM.cmake b/Modules/Platform/Linker/Linux-ASM.cmake new file mode 100644 index 0000000000..67e8e79de3 --- /dev/null +++ b/Modules/Platform/Linker/Linux-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-ASM) diff --git a/Modules/Platform/Linker/Linux-C.cmake b/Modules/Platform/Linker/Linux-C.cmake new file mode 100644 index 0000000000..f40c631dbe --- /dev/null +++ b/Modules/Platform/Linker/Linux-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-C) diff --git a/Modules/Platform/Linker/Linux-CUDA.cmake b/Modules/Platform/Linker/Linux-CUDA.cmake new file mode 100644 index 0000000000..191c347adf --- /dev/null +++ b/Modules/Platform/Linker/Linux-CUDA.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-CUDA) diff --git a/Modules/Platform/Linker/Linux-CXX.cmake b/Modules/Platform/Linker/Linux-CXX.cmake new file mode 100644 index 0000000000..638f3c7057 --- /dev/null +++ b/Modules/Platform/Linker/Linux-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-CXX) diff --git a/Modules/Platform/Linker/Linux-Fortran.cmake b/Modules/Platform/Linker/Linux-Fortran.cmake new file mode 100644 index 0000000000..6bfcc690ae --- /dev/null +++ b/Modules/Platform/Linker/Linux-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-Fortran) diff --git a/Modules/Platform/Linker/Linux-GNU-ASM.cmake b/Modules/Platform/Linker/Linux-GNU-ASM.cmake new file mode 100644 index 0000000000..5812c08320 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/Linux-GNU-C.cmake b/Modules/Platform/Linker/Linux-GNU-C.cmake new file mode 100644 index 0000000000..5bb3224669 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(C) diff --git a/Modules/Platform/Linker/Linux-GNU-CUDA.cmake b/Modules/Platform/Linker/Linux-GNU-CUDA.cmake new file mode 100644 index 0000000000..5a3faa4b30 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(CUDA) diff --git a/Modules/Platform/Linker/Linux-GNU-CXX.cmake b/Modules/Platform/Linker/Linux-GNU-CXX.cmake new file mode 100644 index 0000000000..8b0afa70ef --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/Linux-GNU-Fortran.cmake b/Modules/Platform/Linker/Linux-GNU-Fortran.cmake new file mode 100644 index 0000000000..b7f8a16a75 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/Linux-GNU-HIP.cmake b/Modules/Platform/Linker/Linux-GNU-HIP.cmake new file mode 100644 index 0000000000..6fb9a06ac5 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU) + +__linux_linker_gnu(HIP) diff --git a/Modules/Platform/Linker/Linux-GNU.cmake b/Modules/Platform/Linker/Linux-GNU.cmake new file mode 100644 index 0000000000..b5ca72baa6 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__linux_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/Linux-GNUgold-ASM.cmake b/Modules/Platform/Linker/Linux-GNUgold-ASM.cmake new file mode 100644 index 0000000000..bfef8b9f70 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-ASM) diff --git a/Modules/Platform/Linker/Linux-GNUgold-C.cmake b/Modules/Platform/Linker/Linux-GNUgold-C.cmake new file mode 100644 index 0000000000..2d0efda7e9 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-C) diff --git a/Modules/Platform/Linker/Linux-GNUgold-CUDA.cmake b/Modules/Platform/Linker/Linux-GNUgold-CUDA.cmake new file mode 100644 index 0000000000..d67dc943ce --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-CUDA.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-CUDA) diff --git a/Modules/Platform/Linker/Linux-GNUgold-CXX.cmake b/Modules/Platform/Linker/Linux-GNUgold-CXX.cmake new file mode 100644 index 0000000000..33c46d53a9 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-CXX) diff --git a/Modules/Platform/Linker/Linux-GNUgold-Fortran.cmake b/Modules/Platform/Linker/Linux-GNUgold-Fortran.cmake new file mode 100644 index 0000000000..a01acda3a2 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-Fortran) diff --git a/Modules/Platform/Linker/Linux-GNUgold-HIP.cmake b/Modules/Platform/Linker/Linux-GNUgold-HIP.cmake new file mode 100644 index 0000000000..6d1e4923f0 --- /dev/null +++ b/Modules/Platform/Linker/Linux-GNUgold-HIP.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-GNU-HIP) diff --git a/Modules/Platform/Linker/Linux-HIP.cmake b/Modules/Platform/Linker/Linux-HIP.cmake new file mode 100644 index 0000000000..4c94abc39d --- /dev/null +++ b/Modules/Platform/Linker/Linux-HIP.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/Linux-GNU-HIP) diff --git a/Modules/Platform/Linker/Linux-LLD-ASM.cmake b/Modules/Platform/Linker/Linux-LLD-ASM.cmake new file mode 100644 index 0000000000..7196133c2d --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(ASM) diff --git a/Modules/Platform/Linker/Linux-LLD-C.cmake b/Modules/Platform/Linker/Linux-LLD-C.cmake new file mode 100644 index 0000000000..f8a409ee34 --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(C) diff --git a/Modules/Platform/Linker/Linux-LLD-CUDA.cmake b/Modules/Platform/Linker/Linux-LLD-CUDA.cmake new file mode 100644 index 0000000000..161c7bfba4 --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(CUDA) diff --git a/Modules/Platform/Linker/Linux-LLD-CXX.cmake b/Modules/Platform/Linker/Linux-LLD-CXX.cmake new file mode 100644 index 0000000000..8530a38983 --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(CXX) diff --git a/Modules/Platform/Linker/Linux-LLD-Fortran.cmake b/Modules/Platform/Linker/Linux-LLD-Fortran.cmake new file mode 100644 index 0000000000..70cd3b4742 --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(Fortran) diff --git a/Modules/Platform/Linker/Linux-LLD-HIP.cmake b/Modules/Platform/Linker/Linux-LLD-HIP.cmake new file mode 100644 index 0000000000..ee0849593d --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-LLD) + +__linux_linker_lld(HIP) diff --git a/Modules/Platform/Linker/Linux-LLD.cmake b/Modules/Platform/Linker/Linux-LLD.cmake new file mode 100644 index 0000000000..afe5d1c77b --- /dev/null +++ b/Modules/Platform/Linker/Linux-LLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/Linux-GNU) + + +macro(__linux_linker_lld lang) + __linux_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/Linux-MOLD-ASM.cmake b/Modules/Platform/Linker/Linux-MOLD-ASM.cmake new file mode 100644 index 0000000000..5cc7a71634 --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(ASM) diff --git a/Modules/Platform/Linker/Linux-MOLD-C.cmake b/Modules/Platform/Linker/Linux-MOLD-C.cmake new file mode 100644 index 0000000000..a62c2c9fea --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(C) diff --git a/Modules/Platform/Linker/Linux-MOLD-CUDA.cmake b/Modules/Platform/Linker/Linux-MOLD-CUDA.cmake new file mode 100644 index 0000000000..524803618a --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(CUDA) diff --git a/Modules/Platform/Linker/Linux-MOLD-CXX.cmake b/Modules/Platform/Linker/Linux-MOLD-CXX.cmake new file mode 100644 index 0000000000..4c43624840 --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(CXX) diff --git a/Modules/Platform/Linker/Linux-MOLD-Fortran.cmake b/Modules/Platform/Linker/Linux-MOLD-Fortran.cmake new file mode 100644 index 0000000000..e26bd5db11 --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(Fortran) diff --git a/Modules/Platform/Linker/Linux-MOLD-HIP.cmake b/Modules/Platform/Linker/Linux-MOLD-HIP.cmake new file mode 100644 index 0000000000..5dd6c1615f --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Linux-MOLD) + +__linux_linker_mold(HIP) diff --git a/Modules/Platform/Linker/Linux-MOLD.cmake b/Modules/Platform/Linker/Linux-MOLD.cmake new file mode 100644 index 0000000000..672e699d06 --- /dev/null +++ b/Modules/Platform/Linker/Linux-MOLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/Linux-GNU) + + +macro(__linux_linker_mold lang) + __linux_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/MSYS-ASM.cmake b/Modules/Platform/Linker/MSYS-ASM.cmake new file mode 100644 index 0000000000..9f72f5f359 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-ASM) diff --git a/Modules/Platform/Linker/MSYS-C.cmake b/Modules/Platform/Linker/MSYS-C.cmake new file mode 100644 index 0000000000..5ea9f31c70 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-C) diff --git a/Modules/Platform/Linker/MSYS-CXX.cmake b/Modules/Platform/Linker/MSYS-CXX.cmake new file mode 100644 index 0000000000..a64b5385f0 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-CXX) diff --git a/Modules/Platform/Linker/MSYS-Fortran.cmake b/Modules/Platform/Linker/MSYS-Fortran.cmake new file mode 100644 index 0000000000..390063d4c5 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-Fortran) diff --git a/Modules/Platform/Linker/MSYS-GNU-ASM.cmake b/Modules/Platform/Linker/MSYS-GNU-ASM.cmake new file mode 100644 index 0000000000..f85298e399 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-GNU-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU-ASM) diff --git a/Modules/Platform/Linker/MSYS-GNU-C.cmake b/Modules/Platform/Linker/MSYS-GNU-C.cmake new file mode 100644 index 0000000000..4e6415fe74 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-GNU-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU-C) diff --git a/Modules/Platform/Linker/MSYS-GNU-CXX.cmake b/Modules/Platform/Linker/MSYS-GNU-CXX.cmake new file mode 100644 index 0000000000..2a48ddca89 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-GNU-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU-CXX) diff --git a/Modules/Platform/Linker/MSYS-GNU-Fortran.cmake b/Modules/Platform/Linker/MSYS-GNU-Fortran.cmake new file mode 100644 index 0000000000..5055d22dfa --- /dev/null +++ b/Modules/Platform/Linker/MSYS-GNU-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-GNU-Fortran) diff --git a/Modules/Platform/Linker/MSYS-LLD-ASM.cmake b/Modules/Platform/Linker/MSYS-LLD-ASM.cmake new file mode 100644 index 0000000000..907d084044 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-LLD-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD-ASM) diff --git a/Modules/Platform/Linker/MSYS-LLD-C.cmake b/Modules/Platform/Linker/MSYS-LLD-C.cmake new file mode 100644 index 0000000000..bef158d052 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-LLD-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD-C) diff --git a/Modules/Platform/Linker/MSYS-LLD-CXX.cmake b/Modules/Platform/Linker/MSYS-LLD-CXX.cmake new file mode 100644 index 0000000000..59d9abc386 --- /dev/null +++ b/Modules/Platform/Linker/MSYS-LLD-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD-CXX) diff --git a/Modules/Platform/Linker/MSYS-LLD-Fortran.cmake b/Modules/Platform/Linker/MSYS-LLD-Fortran.cmake new file mode 100644 index 0000000000..f705b91d7a --- /dev/null +++ b/Modules/Platform/Linker/MSYS-LLD-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/CYGWIN-LLD-Fortran) diff --git a/Modules/Platform/Linker/MirBSD-ASM.cmake b/Modules/Platform/Linker/MirBSD-ASM.cmake new file mode 100644 index 0000000000..d2c419e5c6 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-ASM) diff --git a/Modules/Platform/Linker/MirBSD-C.cmake b/Modules/Platform/Linker/MirBSD-C.cmake new file mode 100644 index 0000000000..c59f2511a5 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-C) diff --git a/Modules/Platform/Linker/MirBSD-CXX.cmake b/Modules/Platform/Linker/MirBSD-CXX.cmake new file mode 100644 index 0000000000..9a76d37f26 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-CXX) diff --git a/Modules/Platform/Linker/MirBSD-Fortran.cmake b/Modules/Platform/Linker/MirBSD-Fortran.cmake new file mode 100644 index 0000000000..9ab9886357 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-Fortran) diff --git a/Modules/Platform/Linker/MirBSD-GNU-ASM.cmake b/Modules/Platform/Linker/MirBSD-GNU-ASM.cmake new file mode 100644 index 0000000000..f552a94096 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-GNU-ASM.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU-ASM) diff --git a/Modules/Platform/Linker/MirBSD-GNU-C.cmake b/Modules/Platform/Linker/MirBSD-GNU-C.cmake new file mode 100644 index 0000000000..ad337d0731 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-GNU-C.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU-C) diff --git a/Modules/Platform/Linker/MirBSD-GNU-CXX.cmake b/Modules/Platform/Linker/MirBSD-GNU-CXX.cmake new file mode 100644 index 0000000000..1edb8e8cf7 --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-GNU-CXX.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU-CXX) diff --git a/Modules/Platform/Linker/MirBSD-GNU-Fortran.cmake b/Modules/Platform/Linker/MirBSD-GNU-Fortran.cmake new file mode 100644 index 0000000000..70890a7bde --- /dev/null +++ b/Modules/Platform/Linker/MirBSD-GNU-Fortran.cmake @@ -0,0 +1,4 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU-Fortran) diff --git a/Modules/Platform/Linker/NetBSD-ASM.cmake b/Modules/Platform/Linker/NetBSD-ASM.cmake new file mode 100644 index 0000000000..72a9119f9a --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/NetBSD-GNU-ASM) diff --git a/Modules/Platform/Linker/NetBSD-C.cmake b/Modules/Platform/Linker/NetBSD-C.cmake new file mode 100644 index 0000000000..6e08344c32 --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/NetBSD-GNU-C) diff --git a/Modules/Platform/Linker/NetBSD-CXX.cmake b/Modules/Platform/Linker/NetBSD-CXX.cmake new file mode 100644 index 0000000000..23d6cac929 --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/NetBSD-GNU-CXX) diff --git a/Modules/Platform/Linker/NetBSD-Fortran.cmake b/Modules/Platform/Linker/NetBSD-Fortran.cmake new file mode 100644 index 0000000000..668412777a --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/NetBSD-GNU-Fortran) diff --git a/Modules/Platform/Linker/NetBSD-GNU-ASM.cmake b/Modules/Platform/Linker/NetBSD-GNU-ASM.cmake new file mode 100644 index 0000000000..533589e52c --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/NetBSD-GNU) + +__netbsd_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/NetBSD-GNU-C.cmake b/Modules/Platform/Linker/NetBSD-GNU-C.cmake new file mode 100644 index 0000000000..2f00856460 --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/NetBSD-GNU) + +__netbsd_linker_gnu(C) diff --git a/Modules/Platform/Linker/NetBSD-GNU-CXX.cmake b/Modules/Platform/Linker/NetBSD-GNU-CXX.cmake new file mode 100644 index 0000000000..6e5da900af --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/NetBSD-GNU) + +__netbsd_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/NetBSD-GNU-Fortran.cmake b/Modules/Platform/Linker/NetBSD-GNU-Fortran.cmake new file mode 100644 index 0000000000..83d778494b --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/NetBSD-GNU) + +__netbsd_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/NetBSD-GNU.cmake b/Modules/Platform/Linker/NetBSD-GNU.cmake new file mode 100644 index 0000000000..ef2812a0c3 --- /dev/null +++ b/Modules/Platform/Linker/NetBSD-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__netbsd_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/OpenBSD-ASM.cmake b/Modules/Platform/Linker/OpenBSD-ASM.cmake new file mode 100644 index 0000000000..cd0b25e8c4 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-ASM.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/OpenBSD-GNU-ASM) +else() + include(Platform/Linker/OpenBSD-LLD-ASM) +endif() + +endblock() diff --git a/Modules/Platform/Linker/OpenBSD-C.cmake b/Modules/Platform/Linker/OpenBSD-C.cmake new file mode 100644 index 0000000000..6685807d26 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-C.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/OpenBSD-GNU-C) +else() + include(Platform/Linker/OpenBSD-LLD-C) +endif() + +endblock() diff --git a/Modules/Platform/Linker/OpenBSD-CXX.cmake b/Modules/Platform/Linker/OpenBSD-CXX.cmake new file mode 100644 index 0000000000..4a3d6f8017 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-CXX.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/OpenBSD-GNU-CXX) +else() + include(Platform/Linker/OpenBSD-LLD-CXX) +endif() + +endblock() diff --git a/Modules/Platform/Linker/OpenBSD-Fortran.cmake b/Modules/Platform/Linker/OpenBSD-Fortran.cmake new file mode 100644 index 0000000000..4ec2fe5a1c --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-Fortran.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/BSD-Linker-Initialize) + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(_CMAKE_SYSTEM_LINKER_TYPE STREQUAL "GNU") + include(Platform/Linker/OpenBSD-GNU-Fortran) +else() + include(Platform/Linker/OpenBSD-LLD-Fortran) +endif() + +endblock() diff --git a/Modules/Platform/Linker/OpenBSD-GNU-ASM.cmake b/Modules/Platform/Linker/OpenBSD-GNU-ASM.cmake new file mode 100644 index 0000000000..6ad992d8ab --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU) + +__openbsd_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/OpenBSD-GNU-C.cmake b/Modules/Platform/Linker/OpenBSD-GNU-C.cmake new file mode 100644 index 0000000000..64c8adf2d2 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU) + +__openbsd_linker_gnu(C) diff --git a/Modules/Platform/Linker/OpenBSD-GNU-CXX.cmake b/Modules/Platform/Linker/OpenBSD-GNU-CXX.cmake new file mode 100644 index 0000000000..98668e5656 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU) + +__openbsd_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/OpenBSD-GNU-Fortran.cmake b/Modules/Platform/Linker/OpenBSD-GNU-Fortran.cmake new file mode 100644 index 0000000000..0f2b11f9b7 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-GNU) + +__openbsd_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/OpenBSD-GNU.cmake b/Modules/Platform/Linker/OpenBSD-GNU.cmake new file mode 100644 index 0000000000..50a9d4d1ef --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__openbsd_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/OpenBSD-LLD-ASM.cmake b/Modules/Platform/Linker/OpenBSD-LLD-ASM.cmake new file mode 100644 index 0000000000..008e79a99a --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-LLD) + +__openbsd_linker_lld(ASM) diff --git a/Modules/Platform/Linker/OpenBSD-LLD-C.cmake b/Modules/Platform/Linker/OpenBSD-LLD-C.cmake new file mode 100644 index 0000000000..20f8d12a3a --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-LLD) + +__openbsd_linker_lld(C) diff --git a/Modules/Platform/Linker/OpenBSD-LLD-CXX.cmake b/Modules/Platform/Linker/OpenBSD-LLD-CXX.cmake new file mode 100644 index 0000000000..d0fd59f88c --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-LLD) + +__openbsd_linker_lld(CXX) diff --git a/Modules/Platform/Linker/OpenBSD-LLD-Fortran.cmake b/Modules/Platform/Linker/OpenBSD-LLD-Fortran.cmake new file mode 100644 index 0000000000..55efce3b53 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-LLD-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/OpenBSD-LLD) + +__openbsd_linker_lld(Fortran) diff --git a/Modules/Platform/Linker/OpenBSD-LLD.cmake b/Modules/Platform/Linker/OpenBSD-LLD.cmake new file mode 100644 index 0000000000..522a232f70 --- /dev/null +++ b/Modules/Platform/Linker/OpenBSD-LLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/OpenBSD-GNU) + + +macro(__openbsd_linker_lld lang) + __openbsd_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/SerenityOS-ASM.cmake b/Modules/Platform/Linker/SerenityOS-ASM.cmake new file mode 100644 index 0000000000..98fe46f472 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/SerenityOS-GNU-ASM) diff --git a/Modules/Platform/Linker/SerenityOS-C.cmake b/Modules/Platform/Linker/SerenityOS-C.cmake new file mode 100644 index 0000000000..d4aa953112 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/SerenityOS-GNU-C) diff --git a/Modules/Platform/Linker/SerenityOS-CXX.cmake b/Modules/Platform/Linker/SerenityOS-CXX.cmake new file mode 100644 index 0000000000..34e9311ac9 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# GNU is the default linker +include(Platform/Linker/SerenityOS-GNU-CXX) diff --git a/Modules/Platform/Linker/SerenityOS-GNU-ASM.cmake b/Modules/Platform/Linker/SerenityOS-GNU-ASM.cmake new file mode 100644 index 0000000000..3ea7242607 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-GNU) + +__serenityos_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/SerenityOS-GNU-C.cmake b/Modules/Platform/Linker/SerenityOS-GNU-C.cmake new file mode 100644 index 0000000000..c66d7979fd --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-GNU) + +__serenityos_linker_gnu(C) diff --git a/Modules/Platform/Linker/SerenityOS-GNU-CXX.cmake b/Modules/Platform/Linker/SerenityOS-GNU-CXX.cmake new file mode 100644 index 0000000000..ff1f6777d6 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-GNU) + +__serenityos_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/SerenityOS-GNU.cmake b/Modules/Platform/Linker/SerenityOS-GNU.cmake new file mode 100644 index 0000000000..36ea070501 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__serenityos_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/SerenityOS-LLD-ASM.cmake b/Modules/Platform/Linker/SerenityOS-LLD-ASM.cmake new file mode 100644 index 0000000000..23be6bd832 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-LLD) + +__serenityos_linker_lld(ASM) diff --git a/Modules/Platform/Linker/SerenityOS-LLD-C.cmake b/Modules/Platform/Linker/SerenityOS-LLD-C.cmake new file mode 100644 index 0000000000..43b077c06a --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-LLD) + +__serenityos_linker_lld(C) diff --git a/Modules/Platform/Linker/SerenityOS-LLD-CXX.cmake b/Modules/Platform/Linker/SerenityOS-LLD-CXX.cmake new file mode 100644 index 0000000000..95851ca4d1 --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SerenityOS-LLD) + +__serenityos_linker_lld(CXX) diff --git a/Modules/Platform/Linker/SerenityOS-LLD.cmake b/Modules/Platform/Linker/SerenityOS-LLD.cmake new file mode 100644 index 0000000000..9f34e79a3f --- /dev/null +++ b/Modules/Platform/Linker/SerenityOS-LLD.cmake @@ -0,0 +1,16 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +include(Platform/Linker/SerenityOS-GNU) + + +macro(__serenityos_linker_lld lang) + __serenityos_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Linker/SunOS-ASM.cmake b/Modules/Platform/Linker/SunOS-ASM.cmake new file mode 100644 index 0000000000..0013e0b041 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-ASM.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Solaris is the default linker +include(Platform/Linker/SunOS-Solaris-ASM) diff --git a/Modules/Platform/Linker/SunOS-C.cmake b/Modules/Platform/Linker/SunOS-C.cmake new file mode 100644 index 0000000000..fe90f6a206 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-C.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Solaris is the default linker +include(Platform/Linker/SunOS-Solaris-C) diff --git a/Modules/Platform/Linker/SunOS-CXX.cmake b/Modules/Platform/Linker/SunOS-CXX.cmake new file mode 100644 index 0000000000..0111500d6d --- /dev/null +++ b/Modules/Platform/Linker/SunOS-CXX.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Solaris is the default linker +include(Platform/Linker/SunOS-Solaris-CXX) diff --git a/Modules/Platform/Linker/SunOS-Fortran.cmake b/Modules/Platform/Linker/SunOS-Fortran.cmake new file mode 100644 index 0000000000..6252846ad6 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Fortran.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# Solaris is the default linker +include(Platform/Linker/SunOS-Solaris-Fortran) diff --git a/Modules/Platform/Linker/SunOS-GNU-ASM.cmake b/Modules/Platform/Linker/SunOS-GNU-ASM.cmake new file mode 100644 index 0000000000..d69b617c2c --- /dev/null +++ b/Modules/Platform/Linker/SunOS-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-GNU) + +__sunos_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/SunOS-GNU-C.cmake b/Modules/Platform/Linker/SunOS-GNU-C.cmake new file mode 100644 index 0000000000..76554ced06 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-GNU) + +__sunos_linker_gnu(C) diff --git a/Modules/Platform/Linker/SunOS-GNU-CXX.cmake b/Modules/Platform/Linker/SunOS-GNU-CXX.cmake new file mode 100644 index 0000000000..68b2d8cf1b --- /dev/null +++ b/Modules/Platform/Linker/SunOS-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-GNU) + +__sunos_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/SunOS-GNU-Fortran.cmake b/Modules/Platform/Linker/SunOS-GNU-Fortran.cmake new file mode 100644 index 0000000000..1a7565de13 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-GNU) + +__sunos_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/SunOS-GNU.cmake b/Modules/Platform/Linker/SunOS-GNU.cmake new file mode 100644 index 0000000000..3a2b541ebb --- /dev/null +++ b/Modules/Platform/Linker/SunOS-GNU.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__sunos_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/SunOS-Solaris-ASM.cmake b/Modules/Platform/Linker/SunOS-Solaris-ASM.cmake new file mode 100644 index 0000000000..35ad14936b --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Solaris-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-Solaris) + +__sunos_linker_solaris(ASM) diff --git a/Modules/Platform/Linker/SunOS-Solaris-C.cmake b/Modules/Platform/Linker/SunOS-Solaris-C.cmake new file mode 100644 index 0000000000..6251dcc6ef --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Solaris-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-Solaris) + +__sunos_linker_solaris(C) diff --git a/Modules/Platform/Linker/SunOS-Solaris-CXX.cmake b/Modules/Platform/Linker/SunOS-Solaris-CXX.cmake new file mode 100644 index 0000000000..f6e26451a3 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Solaris-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-Solaris) + +__sunos_linker_solaris(CXX) diff --git a/Modules/Platform/Linker/SunOS-Solaris-Fortran.cmake b/Modules/Platform/Linker/SunOS-Solaris-Fortran.cmake new file mode 100644 index 0000000000..f55b9f25b4 --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Solaris-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/SunOS-Solaris) + +__sunos_linker_solaris(Fortran) diff --git a/Modules/Platform/Linker/SunOS-Solaris.cmake b/Modules/Platform/Linker/SunOS-Solaris.cmake new file mode 100644 index 0000000000..6b2083a7dc --- /dev/null +++ b/Modules/Platform/Linker/SunOS-Solaris.cmake @@ -0,0 +1,9 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +macro(__sunos_linker_solaris lang) +endmacro() diff --git a/Modules/Platform/Linker/Windows-ASM.cmake b/Modules/Platform/Linker/Windows-ASM.cmake new file mode 100644 index 0000000000..bddaed1724 --- /dev/null +++ b/Modules/Platform/Linker/Windows-ASM.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(CMAKE_ASM_SIMULATE_ID STREQUAL "MSVC") + # MSVC is the default linker + include(Platform/Linker/Windows-MSVC-ASM) +else() + # GNU is the default linker + include(Platform/Linker/Windows-GNU-ASM) +endif() + +endblock() diff --git a/Modules/Platform/Linker/Windows-C.cmake b/Modules/Platform/Linker/Windows-C.cmake new file mode 100644 index 0000000000..4a584076ee --- /dev/null +++ b/Modules/Platform/Linker/Windows-C.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC") + # MSVC is the default linker + include(Platform/Linker/Windows-MSVC-C) +else() + # GNU is the default linker + include(Platform/Linker/Windows-GNU-C) +endif() + +endblock() diff --git a/Modules/Platform/Linker/Windows-CUDA.cmake b/Modules/Platform/Linker/Windows-CUDA.cmake new file mode 100644 index 0000000000..7e89791fd4 --- /dev/null +++ b/Modules/Platform/Linker/Windows-CUDA.cmake @@ -0,0 +1,5 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# MSVC is the default linker +include(Platform/Linker/Windows-MSVC-CUDA) diff --git a/Modules/Platform/Linker/Windows-CXX.cmake b/Modules/Platform/Linker/Windows-CXX.cmake new file mode 100644 index 0000000000..29768511da --- /dev/null +++ b/Modules/Platform/Linker/Windows-CXX.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + # MSVC is the default linker + include(Platform/Linker/Windows-MSVC-CXX) +else() + # GNU is the default linker + include(Platform/Linker/Windows-GNU-CXX) +endif() + +endblock() diff --git a/Modules/Platform/Linker/Windows-Fortran.cmake b/Modules/Platform/Linker/Windows-Fortran.cmake new file mode 100644 index 0000000000..928f6d595e --- /dev/null +++ b/Modules/Platform/Linker/Windows-Fortran.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC") + # MSVC is the default linker + include(Platform/Linker/Windows-MSVC-Fortran) +else() + # GNU is the default linker + include(Platform/Linker/Windows-GNU-Fortran) +endif() + +endblock() diff --git a/Modules/Platform/Linker/Windows-GNU-ASM.cmake b/Modules/Platform/Linker/Windows-GNU-ASM.cmake new file mode 100644 index 0000000000..7fac7b1889 --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-GNU) + +__windows_linker_gnu(ASM) diff --git a/Modules/Platform/Linker/Windows-GNU-C.cmake b/Modules/Platform/Linker/Windows-GNU-C.cmake new file mode 100644 index 0000000000..833a64dd7b --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-GNU) + +__windows_linker_gnu(C) diff --git a/Modules/Platform/Linker/Windows-GNU-CXX.cmake b/Modules/Platform/Linker/Windows-GNU-CXX.cmake new file mode 100644 index 0000000000..6bc1af0af3 --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-GNU) + +__windows_linker_gnu(CXX) diff --git a/Modules/Platform/Linker/Windows-GNU-Fortran.cmake b/Modules/Platform/Linker/Windows-GNU-Fortran.cmake new file mode 100644 index 0000000000..4f0c35fe54 --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-GNU) + +__windows_linker_gnu(Fortran) diff --git a/Modules/Platform/Linker/Windows-GNU-HIP.cmake b/Modules/Platform/Linker/Windows-GNU-HIP.cmake new file mode 100644 index 0000000000..4814888ced --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-GNU) + +__windows_linker_gnu(HIP) diff --git a/Modules/Platform/Linker/Windows-GNU.cmake b/Modules/Platform/Linker/Windows-GNU.cmake new file mode 100644 index 0000000000..1d726bfcbe --- /dev/null +++ b/Modules/Platform/Linker/Windows-GNU.cmake @@ -0,0 +1,10 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +macro(__windows_linker_gnu lang) +endmacro() diff --git a/Modules/Platform/Linker/Windows-HIP.cmake b/Modules/Platform/Linker/Windows-HIP.cmake new file mode 100644 index 0000000000..67b37d13eb --- /dev/null +++ b/Modules/Platform/Linker/Windows-HIP.cmake @@ -0,0 +1,15 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +if(CMAKE_HIP_SIMULATE_ID STREQUAL "MSVC") + # MSVC is the default linker + include(Platform/Linker/Windows-MSVC-HIP) +else() + # GNU is the default linker + include(Platform/Linker/Windows-GNU-HIP) +endif() + +endblock() diff --git a/Modules/Platform/Linker/Windows-LLD-ASM.cmake b/Modules/Platform/Linker/Windows-LLD-ASM.cmake new file mode 100644 index 0000000000..fbcc55d1e6 --- /dev/null +++ b/Modules/Platform/Linker/Windows-LLD-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-LLD) + +__windows_linker_lld(ASM) diff --git a/Modules/Platform/Linker/Windows-LLD-C.cmake b/Modules/Platform/Linker/Windows-LLD-C.cmake new file mode 100644 index 0000000000..8efd87e9a0 --- /dev/null +++ b/Modules/Platform/Linker/Windows-LLD-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-LLD) + +__windows_linker_lld(C) diff --git a/Modules/Platform/Linker/Windows-LLD-CXX.cmake b/Modules/Platform/Linker/Windows-LLD-CXX.cmake new file mode 100644 index 0000000000..7bd3131b98 --- /dev/null +++ b/Modules/Platform/Linker/Windows-LLD-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-LLD) + +__windows_linker_lld(CXX) diff --git a/Modules/Platform/Linker/Windows-LLD-HIP.cmake b/Modules/Platform/Linker/Windows-LLD-HIP.cmake new file mode 100644 index 0000000000..4b04a79cd4 --- /dev/null +++ b/Modules/Platform/Linker/Windows-LLD-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-LLD) + +__windows_linker_lld(HIP) diff --git a/Modules/Platform/Linker/Windows-LLD.cmake b/Modules/Platform/Linker/Windows-LLD.cmake new file mode 100644 index 0000000000..f2dde1ad35 --- /dev/null +++ b/Modules/Platform/Linker/Windows-LLD.cmake @@ -0,0 +1,24 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +macro(__windows_linker_lld lang) + # Features for LINK_LIBRARY generator expression + if(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT STREQUAL "GNU") + include(Platform/Linker/Windows-GNU) + __windows_linker_gnu(${lang}) + + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL) + else() + include(Platform/Linker/Windows-MSVC) + __windows_linker_msvc(${lang}) + endif() +endmacro() + +endblock() diff --git a/Modules/Platform/Linker/Windows-MSVC-ASM.cmake b/Modules/Platform/Linker/Windows-MSVC-ASM.cmake new file mode 100644 index 0000000000..df3a64bed7 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-ASM.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(ASM) diff --git a/Modules/Platform/Linker/Windows-MSVC-C.cmake b/Modules/Platform/Linker/Windows-MSVC-C.cmake new file mode 100644 index 0000000000..467c0f34f0 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-C.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(C) diff --git a/Modules/Platform/Linker/Windows-MSVC-CUDA.cmake b/Modules/Platform/Linker/Windows-MSVC-CUDA.cmake new file mode 100644 index 0000000000..dc3d5e9f1d --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-CUDA.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(CUDA) diff --git a/Modules/Platform/Linker/Windows-MSVC-CXX.cmake b/Modules/Platform/Linker/Windows-MSVC-CXX.cmake new file mode 100644 index 0000000000..f5d3294f44 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-CXX.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(CXX) diff --git a/Modules/Platform/Linker/Windows-MSVC-Fortran.cmake b/Modules/Platform/Linker/Windows-MSVC-Fortran.cmake new file mode 100644 index 0000000000..b5f99f3af7 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-Fortran.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(Fortran) diff --git a/Modules/Platform/Linker/Windows-MSVC-HIP.cmake b/Modules/Platform/Linker/Windows-MSVC-HIP.cmake new file mode 100644 index 0000000000..cc2a7daea6 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC-HIP.cmake @@ -0,0 +1,6 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Platform/Linker/Windows-MSVC) + +__windows_linker_msvc(HIP) diff --git a/Modules/Platform/Linker/Windows-MSVC.cmake b/Modules/Platform/Linker/Windows-MSVC.cmake new file mode 100644 index 0000000000..223a057125 --- /dev/null +++ b/Modules/Platform/Linker/Windows-MSVC.cmake @@ -0,0 +1,11 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + + +macro(__windows_linker_msvc lang) + set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL) +endmacro() diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index e3725cb375..489f7bf9fe 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -55,8 +55,6 @@ macro(__windows_compiler_clang_gnu lang) set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") - set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL) - # linker selection set(CMAKE_${lang}_USING_LINKER_DEFAULT "-fuse-ld=lld-link") set(CMAKE_${lang}_USING_LINKER_SYSTEM "-fuse-ld=link") diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index a897e50d46..07f0de415b 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -514,8 +514,6 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_DEPFILE_FORMAT msvc) endif() - set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL) - # linker selection set(CMAKE_${lang}_USING_LINKER_SYSTEM "${CMAKE_LINKER_LINK}") set(CMAKE_${lang}_USING_LINKER_LLD "${CMAKE_LINKER_LLD}") diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 9edbce3a01..309a140667 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -531,6 +531,9 @@ bool cmGlobalGenerator::CheckLanguages( // - Make sure the compiler works with a try compile if // CMakeDetermine(LANG) was loaded // +// CMake(LANG)LinkerInformation.cmake +// - loads Platform/Linker/${CMAKE_SYSTEM_NAME}-${LINKER}.cmake +// // Now load a few files that can override values set in any of the above // (PROJECTNAME)Compatibility.cmake // - load any backwards compatibility stuff for current project @@ -955,6 +958,22 @@ void cmGlobalGenerator::EnableLanguage( } } // end if in try compile } // end need test language + + // load linker configuration + std::string langLinkerLoadedVar = + cmStrCat("CMAKE_", lang, "_LINKER_INFORMATION_LOADED"); + if (!mf->GetDefinition(langLinkerLoadedVar)) { + fpath = cmStrCat("Internal/CMake", lang, "LinkerInformation.cmake"); + std::string informationFile = mf->GetModulesFile(fpath); + if (informationFile.empty()) { + cmSystemTools::Error( + cmStrCat("Could not find cmake module file: ", fpath)); + } else if (!mf->ReadListFile(informationFile)) { + cmSystemTools::Error( + cmStrCat("Could not process cmake module file: ", informationFile)); + } + } + // Store the shared library flags so that we can satisfy CMP0018 std::string sharedLibFlagsVar = cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS"); From 1e35163ae8a333f7586aaa7c4f3a754a5018db49 Mon Sep 17 00:00:00 2001 From: Marc Chevrier Date: Mon, 1 Jul 2024 16:03:10 +0200 Subject: [PATCH 2/2] WHOLE_ARCHIVE link feature: rely now on linker configuration Fixes: #26019 --- Modules/CMakeParseImplicitLinkInfo.cmake | 1 + Modules/Linker/GNU.cmake | 14 ++--- Modules/Platform/CYGWIN-GNU.cmake | 27 ---------- Modules/Platform/Darwin.cmake | 5 -- Modules/Platform/FreeBSD.cmake | 27 ---------- .../Platform/Linker/Apple-AppleClang.cmake | 6 +++ Modules/Platform/Linker/CYGWIN-GNU.cmake | 5 ++ Modules/Platform/Linker/FreeBSD-GNU.cmake | 5 ++ Modules/Platform/Linker/GNU-GNU.cmake | 5 ++ Modules/Platform/Linker/GNU.cmake | 51 +++++++++++++++++++ Modules/Platform/Linker/Linux-GNU.cmake | 5 ++ Modules/Platform/Linker/NetBSD-GNU.cmake | 5 ++ Modules/Platform/Linker/OpenBSD-GNU.cmake | 5 ++ Modules/Platform/Linker/SerenityOS-GNU.cmake | 5 ++ Modules/Platform/Linker/SunOS-GNU.cmake | 5 ++ Modules/Platform/Linker/SunOS-Solaris.cmake | 18 +++++++ Modules/Platform/Linker/Windows-GNU.cmake | 4 ++ Modules/Platform/Linker/Windows-MSVC.cmake | 24 +++++++++ Modules/Platform/Linux-Intel.cmake | 5 ++ Modules/Platform/Linux.cmake | 26 ---------- Modules/Platform/NetBSD.cmake | 27 ---------- Modules/Platform/SunOS.cmake | 15 ------ Modules/Platform/Windows-Clang.cmake | 8 --- Modules/Platform/Windows-GNU.cmake | 26 ---------- Modules/Platform/Windows-IntelLLVM.cmake | 8 --- Modules/Platform/Windows-MSVC.cmake | 8 --- 26 files changed, 157 insertions(+), 183 deletions(-) create mode 100644 Modules/Platform/Linker/GNU.cmake diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 64420b374b..f1b9e898db 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -34,6 +34,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj endif() endfunction() +# FIXME(#26157) linker for Intel legacy compilers is not identified function(cmake_parse_implicit_link_info2 text log_var obj_regex) set(implicit_libs_tmp "") set(implicit_objs_tmp "") diff --git a/Modules/Linker/GNU.cmake b/Modules/Linker/GNU.cmake index cfb630f4e4..1bc57e6c40 100644 --- a/Modules/Linker/GNU.cmake +++ b/Modules/Linker/GNU.cmake @@ -7,15 +7,13 @@ include_guard() block(SCOPE_FOR POLICIES) cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0140 NEW) -macro(__linker_gnu lang) +function(__linker_gnu lang) # define flags for linker depfile generation set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,") set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc) - block(SCOPE_FOR VARIABLES - PROPAGATE CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED - CMAKE_${lang}_LINK_DEPENDS_USE_LINKER) if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED) ## Ensure ninja tool is recent enough... if(CMAKE_GENERATOR MATCHES "^Ninja") @@ -61,7 +59,11 @@ macro(__linker_gnu lang) AND CMAKE_${lang}_COMPILER_LINKER_VERSION VERSION_LESS "2.41") set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE) endif() - endblock() -endmacro() + + return(PROPAGATE CMAKE_${lang}_LINKER_DEPFILE_FLAGS + CMAKE_${lang}_LINKER_DEPFILE_FORMAT + CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED + CMAKE_${lang}_LINK_DEPENDS_USE_LINKER) +endfunction() endblock() diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 01b5f912c4..f3729555ca 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -16,33 +16,6 @@ set(CMAKE_GNULD_IMAGE_VERSION set(CMAKE_GENERATOR_RC windres) -# Features for LINK_LIBRARY generator expression -## check linker capabilities -if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - execute_process(COMMAND "${CMAKE_LINKER}" --help - OUTPUT_VARIABLE __linker_help - ERROR_VARIABLE __linker_help) - if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") - else() - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") - endif() - unset(__linker_help) -endif() -## WHOLE_ARCHIVE: Force loading all members of an archive -if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" - "" - "LINKER:--pop-state") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - - macro(__cygwin_compiler_gnu lang) # Binary link rules. set(CMAKE_${lang}_CREATE_SHARED_MODULE diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index b26912d69a..f334c5f5cd 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -141,11 +141,6 @@ set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY "PATH{LINKER:-weak_library,}N set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY_SUPPORTED TRUE) set(CMAKE_LINK_LIBRARY_WEAK_LIBRARY_ATTRIBUTES LIBRARY_TYPE=STATIC,SHARED DEDUPLICATION=DEFAULT OVERRIDE=DEFAULT) -# Defines LINK_LIBRARY feature to Force loading of all members of an archive -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-force_load,") -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - # default to searching for frameworks first if(NOT DEFINED CMAKE_FIND_FRAMEWORK) set(CMAKE_FIND_FRAMEWORK FIRST) diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index 891422eb8f..c79c181184 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -27,33 +27,6 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE) endforeach() -# Features for LINK_LIBRARY generator expression -## check linker capabilities -if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - execute_process(COMMAND "${CMAKE_LINKER}" --help - OUTPUT_VARIABLE __linker_help - ERROR_VARIABLE __linker_help) - if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") - else() - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") - endif() - unset(__linker_help) -endif() -## WHOLE_ARCHIVE: Force loading all members of an archive -if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" - "" - "LINKER:--pop-state") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - - # Features for LINK_GROUP generator expression ## RESCAN: request the linker to rescan static libraries until there is ## no pending undefined symbols diff --git a/Modules/Platform/Linker/Apple-AppleClang.cmake b/Modules/Platform/Linker/Apple-AppleClang.cmake index 71376e7125..7582ae9e5c 100644 --- a/Modules/Platform/Linker/Apple-AppleClang.cmake +++ b/Modules/Platform/Linker/Apple-AppleClang.cmake @@ -7,4 +7,10 @@ include_guard() macro(__apple_linker_appleclang lang) set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE DEDUPLICATION=ALL) + + # Features for LINK_LIBRARY generator expression + ## WHOLE_ARCHIVE: Force loading all members of an archive + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-force_load,") + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) + set(CMAKE_${lang}_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) endmacro() diff --git a/Modules/Platform/Linker/CYGWIN-GNU.cmake b/Modules/Platform/Linker/CYGWIN-GNU.cmake index 538f611e15..8e5b97093b 100644 --- a/Modules/Platform/Linker/CYGWIN-GNU.cmake +++ b/Modules/Platform/Linker/CYGWIN-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__cygwin_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/FreeBSD-GNU.cmake b/Modules/Platform/Linker/FreeBSD-GNU.cmake index 82f41fc195..f88485702e 100644 --- a/Modules/Platform/Linker/FreeBSD-GNU.cmake +++ b/Modules/Platform/Linker/FreeBSD-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__freebsd_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/GNU-GNU.cmake b/Modules/Platform/Linker/GNU-GNU.cmake index f04e911c4b..a1adf14a63 100644 --- a/Modules/Platform/Linker/GNU-GNU.cmake +++ b/Modules/Platform/Linker/GNU-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__gnu_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/GNU.cmake b/Modules/Platform/Linker/GNU.cmake new file mode 100644 index 0000000000..5f1167418b --- /dev/null +++ b/Modules/Platform/Linker/GNU.cmake @@ -0,0 +1,51 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + + +# This module is shared by multiple languages; use include blocker. +include_guard() + +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +# WHOLE_ARCHIVE Feature for LINK_LIBRARY generator expression +## check linker capabilities +function(__cmake_set_whole_archive_feature __linker) + unset(__lang) + if(ARGC EQUAL "2") + set(__lang "${ARGV1}_") + endif() + + if(NOT __linker) + set(_CMAKE_${__lang}LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") + endif() + + if(NOT DEFINED _CMAKE_${__lang}LINKER_PUSHPOP_STATE_SUPPORTED) + execute_process(COMMAND "${__linker}" --help + OUTPUT_VARIABLE __linker_help + ERROR_VARIABLE __linker_help) + if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") + set(_CMAKE_${__lang}LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") + else() + set(_CMAKE_${__lang}LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") + endif() + endif() + ## WHOLE_ARCHIVE: Force loading all members of an archive + if(_CMAKE_${__lang}LINKER_PUSHPOP_STATE_SUPPORTED) + set(CMAKE_${__lang}LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" + "" + "LINKER:--pop-state" PARENT_SCOPE) + else() + set(CMAKE_${__lang}LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" + "" + "LINKER:--no-whole-archive" PARENT_SCOPE) + endif() + set(CMAKE_${__lang}LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE PARENT_SCOPE) + set(CMAKE_${__lang}LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT PARENT_SCOPE) +endfunction() + + +## Configure system linker +__cmake_set_whole_archive_feature("${CMAKE_LINKER}") + +endblock() diff --git a/Modules/Platform/Linker/Linux-GNU.cmake b/Modules/Platform/Linker/Linux-GNU.cmake index b5ca72baa6..6668141aef 100644 --- a/Modules/Platform/Linker/Linux-GNU.cmake +++ b/Modules/Platform/Linker/Linux-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__linux_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/NetBSD-GNU.cmake b/Modules/Platform/Linker/NetBSD-GNU.cmake index ef2812a0c3..f06e491baf 100644 --- a/Modules/Platform/Linker/NetBSD-GNU.cmake +++ b/Modules/Platform/Linker/NetBSD-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__netbsd_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/OpenBSD-GNU.cmake b/Modules/Platform/Linker/OpenBSD-GNU.cmake index 50a9d4d1ef..b30e4679f2 100644 --- a/Modules/Platform/Linker/OpenBSD-GNU.cmake +++ b/Modules/Platform/Linker/OpenBSD-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__openbsd_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/SerenityOS-GNU.cmake b/Modules/Platform/Linker/SerenityOS-GNU.cmake index 36ea070501..9b06bfb675 100644 --- a/Modules/Platform/Linker/SerenityOS-GNU.cmake +++ b/Modules/Platform/Linker/SerenityOS-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__serenityos_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/SunOS-GNU.cmake b/Modules/Platform/Linker/SunOS-GNU.cmake index 3a2b541ebb..693e31a463 100644 --- a/Modules/Platform/Linker/SunOS-GNU.cmake +++ b/Modules/Platform/Linker/SunOS-GNU.cmake @@ -5,5 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) + macro(__sunos_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/SunOS-Solaris.cmake b/Modules/Platform/Linker/SunOS-Solaris.cmake index 6b2083a7dc..cf82bf8d5c 100644 --- a/Modules/Platform/Linker/SunOS-Solaris.cmake +++ b/Modules/Platform/Linker/SunOS-Solaris.cmake @@ -5,5 +5,23 @@ # This module is shared by multiple languages; use include blocker. include_guard() +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + macro(__sunos_linker_solaris lang) + # Features for LINK_LIBRARY generator expression + ## WHOLE_ARCHIVE: Force loading all members of an archive + if (CMAKE_SYSTEM_VERSION VERSION_GREATER "5.10") + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" + "" + "LINKER:--no-whole-archive") + else() + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-z,allextract" + "" + "LINKER:-z,defaultextract") + endif() + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) + set(CMAKE_${lang}_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) endmacro() + +endblock() diff --git a/Modules/Platform/Linker/Windows-GNU.cmake b/Modules/Platform/Linker/Windows-GNU.cmake index 1d726bfcbe..a5c4417aa6 100644 --- a/Modules/Platform/Linker/Windows-GNU.cmake +++ b/Modules/Platform/Linker/Windows-GNU.cmake @@ -5,6 +5,10 @@ # This module is shared by multiple languages; use include blocker. include_guard() +include(Platform/Linker/GNU) macro(__windows_linker_gnu lang) + if(CMAKE_${lang}_COMPILER_LINKER) + __cmake_set_whole_archive_feature("${CMAKE_${lang}_COMPILER_LINKER}" "${lang}") + endif() endmacro() diff --git a/Modules/Platform/Linker/Windows-MSVC.cmake b/Modules/Platform/Linker/Windows-MSVC.cmake index 223a057125..2eb571392f 100644 --- a/Modules/Platform/Linker/Windows-MSVC.cmake +++ b/Modules/Platform/Linker/Windows-MSVC.cmake @@ -5,7 +5,31 @@ # This module is shared by multiple languages; use include blocker. include_guard() +block(SCOPE_FOR POLICIES) +cmake_policy(SET CMP0054 NEW) + +# Features for LINK_LIBRARY generator expression +if(MSVC_VERSION GREATER "1900") + ## WHOLE_ARCHIVE: Force loading all members of an archive + set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:") + set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) + set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) +endif() macro(__windows_linker_msvc lang) set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD DEDUPLICATION=ALL) + + # Features for LINK_LIBRARY generator expression + if(DEFINED CMAKE_${lang}_COMPILER_LINKER_VERSION) + if (CMAKE_${lang}_COMPILER_LINKER_VERSION GREATER_EQUAL "14.10") + ## WHOLE_ARCHIVE: Force loading all members of an archive + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:") + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) + set(CMAKE_${lang}_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) + else() + set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED FALSE) + endif() + endif() endmacro() + +endblock() diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake index 3b5ca59cac..95debf96d9 100644 --- a/Modules/Platform/Linux-Intel.cmake +++ b/Modules/Platform/Linux-Intel.cmake @@ -39,6 +39,11 @@ macro(__linux_compiler_intel lang) set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + # FIXME(#26157): compute CMAKE__COMPILER_LINKER* variables + # in the meantime, enforce deactivation of push/pop state linker options + # because xild front-end linker do not support these options even if the platform linker does... + set(_CMAKE_${lang}_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) if(XIAR) diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index a73bbf74fb..5b61dd6b61 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -20,32 +20,6 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE) endforeach() -# Features for LINK_LIBRARY generator expression -## check linker capabilities -if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - execute_process(COMMAND "${CMAKE_LINKER}" --help - OUTPUT_VARIABLE __linker_help - ERROR_VARIABLE __linker_help) - if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") - else() - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") - endif() - unset(__linker_help) -endif() -## WHOLE_ARCHIVE: Force loading all members of an archive -if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" - "" - "LINKER:--pop-state") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - # Features for LINK_GROUP generator expression ## RESCAN: request the linker to rescan static libraries until there is ## no pending undefined symbols diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index 892d55ba19..110212b4a8 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -13,33 +13,6 @@ set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") -# Features for LINK_LIBRARY generator expression -## check linker capabilities -if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - execute_process(COMMAND "${CMAKE_LINKER}" --help - OUTPUT_VARIABLE __linker_help - ERROR_VARIABLE __linker_help) - if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") - else() - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") - endif() - unset(__linker_help) -endif() -## WHOLE_ARCHIVE: Force loading all members of an archive -if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" - "" - "LINKER:--pop-state") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - - # Features for LINK_GROUP generator expression ## RESCAN: request the linker to rescan static libraries until there is ## no pending undefined symbols diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index 25e95e6bc5..e01e892283 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -8,21 +8,6 @@ if(CMAKE_SYSTEM MATCHES "SunOS-4") endif() -# Features for LINK_LIBRARY generator expression -## WHOLE_ARCHIVE: Force loading all members of an archive -if (CMAKE_SYSTEM_VERSION VERSION_GREATER "5.10") - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-z,allextract" - "" - "LINKER:-z,defaultextract") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - - # Features for LINK_GROUP generator expression if (CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9") ## RESCAN: request the linker to rescan static libraries until there is diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index 489f7bf9fe..7a054928ea 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -133,14 +133,6 @@ macro(__windows_compiler_clang_gnu lang) string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER) set(CMAKE_${lang}_STANDARD_LIBRARIES_INIT "-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames") - # Features for LINK_LIBRARY generator expression - if(MSVC_VERSION GREATER "1900") - ## WHOLE_ARCHIVE: Force loading all members of an archive - set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:") - set(CMAKE_${lang}_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) - set(CMAKE_${lang}_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - endif() - enable_language(RC) endmacro() diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 1a4159bcd2..7dc92cd91f 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -64,32 +64,6 @@ if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]") endif() -# Features for LINK_LIBRARY generator expression -## check linker capabilities -if(NOT DEFINED _CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - execute_process(COMMAND "${CMAKE_LINKER}" --help - OUTPUT_VARIABLE __linker_help - ERROR_VARIABLE __linker_help) - if(__linker_help MATCHES "--push-state" AND __linker_help MATCHES "--pop-state") - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED TRUE CACHE INTERNAL "linker supports push/pop state") - else() - set(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED FALSE CACHE INTERNAL "linker supports push/pop state") - endif() - unset(__linker_help) -endif() -## WHOLE_ARCHIVE: Force loading all members of an archive -if(_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED) - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--push-state,--whole-archive" - "" - "LINKER:--pop-state") -else() - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:--whole-archive" - "" - "LINKER:--no-whole-archive") -endif() -set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) -set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - # Features for LINK_GROUP generator expression ## RESCAN: request the linker to rescan static libraries until there is ## no pending undefined symbols diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake index 517d959592..ba2cc9c09f 100644 --- a/Modules/Platform/Windows-IntelLLVM.cmake +++ b/Modules/Platform/Windows-IntelLLVM.cmake @@ -32,14 +32,6 @@ macro(__windows_compiler_intel lang) set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:") set(CMAKE_LIBRARY_PATH_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/LIBPATH:") - # Features for LINK_LIBRARY generator expression - if(MSVC_VERSION GREATER "1900") - ## WHOLE_ARCHIVE: Force loading all members of an archive - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:/WHOLEARCHIVE:") - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) - set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) - endif() - set(CMAKE_${lang}_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /link /out: /implib: /pdb: /version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_LIBRARY diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 07f0de415b..189d1fd5a2 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -353,14 +353,6 @@ else() endif() unset(__WINDOWS_MSVC_CMP0141) -# Features for LINK_LIBRARY generator expression -if(MSVC_VERSION GREATER "1900") - ## WHOLE_ARCHIVE: Force loading all members of an archive - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "/WHOLEARCHIVE:") - set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE) - set(CMAKE_LINK_LIBRARY_WHOLE_ARCHIVE_ATTRIBUTES LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT) -endif() - macro(__windows_compiler_msvc lang) if(NOT MSVC_VERSION LESS 1400)