2024-04-12 16:15:33 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2011-2024 C. Fernandez-Prades cfernandez(at)cttc.es
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2024-04-13 07:03:46 +00:00
|
|
|
if(DEFINED __INCLUDED_XCODE_REMOVE_WARNING_DUPLICATES_CMAKE)
|
2024-04-12 16:15:33 +00:00
|
|
|
return()
|
|
|
|
endif()
|
2024-04-13 07:03:46 +00:00
|
|
|
set(__INCLUDED_XCODE_REMOVE_WARNING_DUPLICATES_CMAKE TRUE)
|
2024-04-12 16:15:33 +00:00
|
|
|
|
2024-04-13 07:03:46 +00:00
|
|
|
function(xcode_remove_warning_duplicates target)
|
2024-04-12 17:51:37 +00:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
|
2024-04-12 16:15:33 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0.0")
|
|
|
|
# A bug in Xcode 15 adds duplicate flags to the linker. In addition, the
|
|
|
|
# `-warn_duplicate_libraries` is now enabled by default which may result
|
|
|
|
# in several 'duplicate libraries warning'.
|
|
|
|
# - https://gitlab.kitware.com/cmake/cmake/-/issues/25297 and
|
|
|
|
# - https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/
|
|
|
|
target_link_options(${target} PUBLIC "LINKER:-no_warn_duplicate_libraries")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endfunction()
|