mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
Merge topic 'link-warning-as-error'
7907c83175Link step: Add LINK_WARNING_AS_ERROR target property656267c871COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9984
This commit is contained in:
@@ -6,4 +6,6 @@
|
||||
include_guard()
|
||||
|
||||
macro(__linker_aix lang)
|
||||
# Linker warning as error
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR "LINKER:-bhalt:0")
|
||||
endmacro()
|
||||
|
||||
@@ -7,4 +7,6 @@
|
||||
include_guard()
|
||||
|
||||
macro(__linker_appleclang lang)
|
||||
# Linker warning as error
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR "LINKER:-fatal_warnings")
|
||||
endmacro()
|
||||
|
||||
@@ -65,10 +65,14 @@ function(__linker_gnu lang)
|
||||
set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE)
|
||||
endif()
|
||||
|
||||
# Linker warning as error
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR "LINKER:--fatal-warnings")
|
||||
|
||||
return(PROPAGATE CMAKE_${lang}_LINKER_DEPFILE_FLAGS
|
||||
CMAKE_${lang}_LINKER_DEPFILE_FORMAT
|
||||
CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED
|
||||
CMAKE_${lang}_LINK_DEPENDS_USE_LINKER)
|
||||
CMAKE_${lang}_LINK_DEPENDS_USE_LINKER
|
||||
CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR)
|
||||
endfunction()
|
||||
|
||||
endblock()
|
||||
|
||||
@@ -3,8 +3,20 @@
|
||||
|
||||
include_guard()
|
||||
|
||||
include(Linker/GNU)
|
||||
|
||||
block(SCOPE_FOR POLICIES)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
macro(__linker_lld lang)
|
||||
__linker_gnu(${lang})
|
||||
if(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||
include(Linker/MSVC)
|
||||
|
||||
__linker_msvc(${lang})
|
||||
else()
|
||||
include(Linker/GNU)
|
||||
|
||||
__linker_gnu(${lang})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
endblock()
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(ASM)
|
||||
__linker_mold(ASM)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(C)
|
||||
__linker_mold(C)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(CUDA)
|
||||
__linker_mold(CUDA)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(CXX)
|
||||
__linker_mold(CXX)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(Fortran)
|
||||
__linker_mold(Fortran)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(HIP)
|
||||
__linker_mold(HIP)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(OBJC)
|
||||
__linker_mold(OBJC)
|
||||
|
||||
@@ -1,6 +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)
|
||||
include(Linker/MOLD)
|
||||
|
||||
__linker_gnu(OBJCXX)
|
||||
__linker_mold(OBJCXX)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# 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_mold lang)
|
||||
if(CMAKE_EFFECTIVE_SYSTEM_NAME STREQUAL "Apple")
|
||||
include(Linker/AppleClang)
|
||||
|
||||
__linker_appleclang(${lang})
|
||||
else()
|
||||
include(Linker/GNU)
|
||||
|
||||
__linker_gnu(${lang})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
endblock()
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(ASM)
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(C)
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(CUDA)
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(CXX)
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(Fortran)
|
||||
@@ -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/MSVC)
|
||||
|
||||
__linker_msvc(HIP)
|
||||
@@ -0,0 +1,12 @@
|
||||
# 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_msvc lang)
|
||||
# Linker warning as error
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR "LINKER:/WX")
|
||||
endmacro()
|
||||
@@ -6,4 +6,6 @@
|
||||
include_guard()
|
||||
|
||||
macro(__linker_solaris lang)
|
||||
# Linker warning as error
|
||||
set(CMAKE_${lang}_LINK_OPTIONS_WARNING_AS_ERROR "LINKER:-z,fatal-warnings")
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user