Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,21 @@ if (CLR_CMAKE_HOST_UNIX)
# a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets
# replaced with a default value, and always gets expanded to an OS version.
# https://gitlab.kitware.com/cmake/cmake/-/issues/20132
# We need to disable the warning that -tagret replaces -mmacosx-version-min
set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
add_link_options(-Wno-overriding-t-option)
# We need to disable the warning that -target replaces -mmacosx-version-min
#
# With https://github.com/llvm/llvm-project/commit/1c66d08b0137cef7761b8220d3b7cb7833f57cdb clang renamed the option so we need to check for both
check_c_compiler_flag("-Wno-overriding-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
if (COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-option)
else()
check_c_compiler_flag("-Wno-overriding-t-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
if (COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
else()
message(FATAL_ERROR "Compiler does not support -Wno-overriding-option or -Wno-overriding-t-option, needed for Mac Catalyst builds.")
endif()
endif()
add_link_options(${DISABLE_OVERRIDING_MIN_VERSION_ERROR})
if(CLR_CMAKE_HOST_ARCH_ARM64)
set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "arm64-apple-ios15.0-macabi")
add_link_options(-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET})
Expand Down
21 changes: 21 additions & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,27 @@ if(GCC)
set(WARNINGS "${WARNINGS} -Qunused-arguments -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand -Wno-zero-length-array -Wno-asm-operand-widths")
endif()

if (HOST_MACCAT)
# Somewhere between CMake 3.17 and 3.19.4, it became impossible to not pass
# a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets
# replaced with a default value, and always gets expanded to an OS version.
# https://gitlab.kitware.com/cmake/cmake/-/issues/20132
# We need to disable the warning that -target replaces -mmacosx-version-min
#
# With https://github.com/llvm/llvm-project/commit/1c66d08b0137cef7761b8220d3b7cb7833f57cdb clang renamed the option so we need to check for both
check_c_compiler_flag("-Wno-overriding-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
if (COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
set(WARNINGS "${WARNINGS} -Wno-overriding-option")
else()
check_c_compiler_flag("-Wno-overriding-t-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
if (COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
set(WARNINGS "${WARNINGS} -Wno-overriding-t-option")
else()
message(FATAL_ERROR "Compiler does not support -Wno-overriding-option or -Wno-overriding-t-option, needed for Mac Catalyst builds.")
endif()
endif()
endif()

check_c_compiler_flag("-Werror=incompatible-pointer-types" WERROR_INCOMPATIBLE_POINTER_TYPES)
if(WERROR_INCOMPATIBLE_POINTER_TYPES)
set(WERROR_C "${WERROR_C} -Werror=incompatible-pointer-types")
Expand Down
2 changes: 0 additions & 2 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,6 @@ JS_ENGINES = [NODE_JS]
<ItemGroup Condition="'$(TargetsMacCatalyst)' == 'true'">
<_MonoCMakeArgs Include="-DCMAKE_SYSTEM_VARIANT=maccatalyst" />
<_MonoCMakeArgs Include="-DBUILD_DARWIN_FRAMEWORKS=1" />
<!-- https://gitlab.kitware.com/cmake/cmake/-/issues/20132 -->
<_MonoCPPFLAGS Include="-Wno-overriding-t-option" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" />
Expand Down
Loading