mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-18 09:50:35 -05:00
Platform: Add compiler platform modules for BSDs
These set variables required for CMAKE_LINKER_TYPE to work Fixes: #27037
This commit is contained in:
1
Modules/Platform/FreeBSD-Clang-ASM.cmake
Normal file
1
Modules/Platform/FreeBSD-Clang-ASM.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/FreeBSD-GNU-ASM)
|
||||||
1
Modules/Platform/FreeBSD-Clang-C.cmake
Normal file
1
Modules/Platform/FreeBSD-Clang-C.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/FreeBSD-GNU-C)
|
||||||
1
Modules/Platform/FreeBSD-Clang-CXX.cmake
Normal file
1
Modules/Platform/FreeBSD-Clang-CXX.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/FreeBSD-GNU-CXX)
|
||||||
2
Modules/Platform/FreeBSD-GNU-ASM.cmake
Normal file
2
Modules/Platform/FreeBSD-GNU-ASM.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/FreeBSD-GNU)
|
||||||
|
__freebsd_compiler_gnu(ASM)
|
||||||
2
Modules/Platform/FreeBSD-GNU-C.cmake
Normal file
2
Modules/Platform/FreeBSD-GNU-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/FreeBSD-GNU)
|
||||||
|
__freebsd_compiler_gnu(C)
|
||||||
2
Modules/Platform/FreeBSD-GNU-CXX.cmake
Normal file
2
Modules/Platform/FreeBSD-GNU-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/FreeBSD-GNU)
|
||||||
|
__freebsd_compiler_gnu(CXX)
|
||||||
2
Modules/Platform/FreeBSD-GNU-Fortran.cmake
Normal file
2
Modules/Platform/FreeBSD-GNU-Fortran.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/FreeBSD-GNU)
|
||||||
|
__freebsd_compiler_gnu(Fortran)
|
||||||
16
Modules/Platform/FreeBSD-GNU.cmake
Normal file
16
Modules/Platform/FreeBSD-GNU.cmake
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
include_guard()
|
||||||
|
|
||||||
|
macro(__freebsd_compiler_gnu lang)
|
||||||
|
# linker selection
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_BFD "-fuse-ld=bfd")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_GOLD "-fuse-ld=gold")
|
||||||
|
if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "GNU"
|
||||||
|
OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_MOLD "-fuse-ld=mold")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
2
Modules/Platform/MirBSD-GNU-ASM.cmake
Normal file
2
Modules/Platform/MirBSD-GNU-ASM.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/MirBSD-GNU)
|
||||||
|
__mirbsd_compiler_gnu(ASM)
|
||||||
2
Modules/Platform/MirBSD-GNU-C.cmake
Normal file
2
Modules/Platform/MirBSD-GNU-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/MirBSD-GNU)
|
||||||
|
__mirbsd_compiler_gnu(C)
|
||||||
2
Modules/Platform/MirBSD-GNU-CXX.cmake
Normal file
2
Modules/Platform/MirBSD-GNU-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/MirBSD-GNU)
|
||||||
|
__mirbsd_compiler_gnu(CXX)
|
||||||
2
Modules/Platform/MirBSD-GNU-Fortran.cmake
Normal file
2
Modules/Platform/MirBSD-GNU-Fortran.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/MirBSD-GNU)
|
||||||
|
__mirbsd_compiler_gnu(Fortran)
|
||||||
7
Modules/Platform/MirBSD-GNU.cmake
Normal file
7
Modules/Platform/MirBSD-GNU.cmake
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
include_guard()
|
||||||
|
|
||||||
|
include(Platform/OpenBSD-GNU)
|
||||||
|
|
||||||
|
macro(__mirbsd_compiler_gnu lang)
|
||||||
|
__openbsd_compiler_gnu(${lang})
|
||||||
|
endmacro()
|
||||||
1
Modules/Platform/NetBSD-Clang-ASM.cmake
Normal file
1
Modules/Platform/NetBSD-Clang-ASM.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/NetBSD-GNU-ASM)
|
||||||
1
Modules/Platform/NetBSD-Clang-C.cmake
Normal file
1
Modules/Platform/NetBSD-Clang-C.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/NetBSD-GNU-C)
|
||||||
1
Modules/Platform/NetBSD-Clang-CXX.cmake
Normal file
1
Modules/Platform/NetBSD-Clang-CXX.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/NetBSD-GNU-CXX)
|
||||||
2
Modules/Platform/NetBSD-GNU-ASM.cmake
Normal file
2
Modules/Platform/NetBSD-GNU-ASM.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/NetBSD-GNU)
|
||||||
|
__netbsd_compiler_gnu(ASM)
|
||||||
2
Modules/Platform/NetBSD-GNU-C.cmake
Normal file
2
Modules/Platform/NetBSD-GNU-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/NetBSD-GNU)
|
||||||
|
__netbsd_compiler_gnu(C)
|
||||||
2
Modules/Platform/NetBSD-GNU-CXX.cmake
Normal file
2
Modules/Platform/NetBSD-GNU-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/NetBSD-GNU)
|
||||||
|
__netbsd_compiler_gnu(CXX)
|
||||||
2
Modules/Platform/NetBSD-GNU-Fortran.cmake
Normal file
2
Modules/Platform/NetBSD-GNU-Fortran.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/NetBSD-GNU)
|
||||||
|
__netbsd_compiler_gnu(Fortran)
|
||||||
16
Modules/Platform/NetBSD-GNU.cmake
Normal file
16
Modules/Platform/NetBSD-GNU.cmake
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
include_guard()
|
||||||
|
|
||||||
|
macro(__netbsd_compiler_gnu lang)
|
||||||
|
# linker selection
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_BFD "-fuse-ld=bfd")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_GOLD "-fuse-ld=gold")
|
||||||
|
if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "GNU"
|
||||||
|
OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
|
||||||
|
set(CMAKE_${lang}_USING_LINKER_MOLD "-fuse-ld=mold")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
1
Modules/Platform/OpenBSD-Clang-ASM.cmake
Normal file
1
Modules/Platform/OpenBSD-Clang-ASM.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/OpenBSD-GNU-ASM)
|
||||||
1
Modules/Platform/OpenBSD-Clang-C.cmake
Normal file
1
Modules/Platform/OpenBSD-Clang-C.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/OpenBSD-GNU-C)
|
||||||
1
Modules/Platform/OpenBSD-Clang-CXX.cmake
Normal file
1
Modules/Platform/OpenBSD-Clang-CXX.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(Platform/OpenBSD-GNU-CXX)
|
||||||
2
Modules/Platform/OpenBSD-GNU-ASM.cmake
Normal file
2
Modules/Platform/OpenBSD-GNU-ASM.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/OpenBSD-GNU)
|
||||||
|
__openbsd_compiler_gnu(ASM)
|
||||||
2
Modules/Platform/OpenBSD-GNU-C.cmake
Normal file
2
Modules/Platform/OpenBSD-GNU-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/OpenBSD-GNU)
|
||||||
|
__openbsd_compiler_gnu(C)
|
||||||
2
Modules/Platform/OpenBSD-GNU-CXX.cmake
Normal file
2
Modules/Platform/OpenBSD-GNU-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/OpenBSD-GNU)
|
||||||
|
__openbsd_compiler_gnu(CXX)
|
||||||
2
Modules/Platform/OpenBSD-GNU-Fortran.cmake
Normal file
2
Modules/Platform/OpenBSD-GNU-Fortran.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/OpenBSD-GNU)
|
||||||
|
__openbsd_compiler_gnu(Fortran)
|
||||||
7
Modules/Platform/OpenBSD-GNU.cmake
Normal file
7
Modules/Platform/OpenBSD-GNU.cmake
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
include_guard()
|
||||||
|
|
||||||
|
include(Platform/NetBSD-GNU)
|
||||||
|
|
||||||
|
macro(__openbsd_compiler_gnu lang)
|
||||||
|
__netbsd_compiler_gnu(${lang})
|
||||||
|
endmacro()
|
||||||
@@ -939,7 +939,7 @@ if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin|Windows)"
|
if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin|Windows|OpenBSD|FreeBSD|NetBSD|MirBSD)"
|
||||||
AND CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU|MSVC|NVIDIA)$"
|
AND CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU|MSVC|NVIDIA)$"
|
||||||
AND NOT CMAKE_GENERATOR STREQUAL "Green Hills MULTI")
|
AND NOT CMAKE_GENERATOR STREQUAL "Green Hills MULTI")
|
||||||
add_RunCMake_test(LinkerSelection -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
|
add_RunCMake_test(LinkerSelection -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
|
||||||
|
|||||||
Reference in New Issue
Block a user