File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -676,9 +676,21 @@ if (CLR_CMAKE_HOST_UNIX)
676
676
# a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets
677
677
# replaced with a default value, and always gets expanded to an OS version.
678
678
# https://gitlab.kitware.com/cmake/cmake/-/issues/20132
679
- # We need to disable the warning that -tagret replaces -mmacosx-version-min
680
- set (DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
681
- add_link_options (-Wno-overriding-t-option)
679
+ # We need to disable the warning that -target replaces -mmacosx-version-min
680
+ #
681
+ # With https://github.com/llvm/llvm-project/commit/1c66d08b0137cef7761b8220d3b7cb7833f57cdb clang renamed the option so we need to check for both
682
+ check_c_compiler_flag("-Wno-overriding-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
683
+ if (COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
684
+ set (DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-option)
685
+ else ()
686
+ check_c_compiler_flag("-Wno-overriding-t-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
687
+ if (COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
688
+ set (DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
689
+ else ()
690
+ message (FATAL_ERROR "Compiler does not support -Wno-overriding-option or -Wno-overriding-t-option, needed for Mac Catalyst builds." )
691
+ endif ()
692
+ endif ()
693
+ add_link_options (${DISABLE_OVERRIDING_MIN_VERSION_ERROR} )
682
694
if (CLR_CMAKE_HOST_ARCH_ARM64)
683
695
set (CLR_CMAKE_MACCATALYST_COMPILER_TARGET "arm64-apple-ios15.0-macabi" )
684
696
add_link_options (-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} )
Original file line number Diff line number Diff line change @@ -545,6 +545,27 @@ if(GCC)
545
545
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" )
546
546
endif ()
547
547
548
+ if (HOST_MACCAT)
549
+ # Somewhere between CMake 3.17 and 3.19.4, it became impossible to not pass
550
+ # a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets
551
+ # replaced with a default value, and always gets expanded to an OS version.
552
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20132
553
+ # We need to disable the warning that -target replaces -mmacosx-version-min
554
+ #
555
+ # With https://github.com/llvm/llvm-project/commit/1c66d08b0137cef7761b8220d3b7cb7833f57cdb clang renamed the option so we need to check for both
556
+ check_c_compiler_flag("-Wno-overriding-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
557
+ if (COMPILER_SUPPORTS_W_NO_OVERRIDING_OPTION)
558
+ set (WARNINGS "${WARNINGS} -Wno-overriding-option" )
559
+ else ()
560
+ check_c_compiler_flag("-Wno-overriding-t-option" COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
561
+ if (COMPILER_SUPPORTS_W_NO_OVERRIDING_T_OPTION)
562
+ set (WARNINGS "${WARNINGS} -Wno-overriding-t-option" )
563
+ else ()
564
+ message (FATAL_ERROR "Compiler does not support -Wno-overriding-option or -Wno-overriding-t-option, needed for Mac Catalyst builds." )
565
+ endif ()
566
+ endif ()
567
+ endif ()
568
+
548
569
check_c_compiler_flag("-Werror=incompatible-pointer-types" WERROR_INCOMPATIBLE_POINTER_TYPES)
549
570
if (WERROR_INCOMPATIBLE_POINTER_TYPES)
550
571
set (WERROR_C "${WERROR_C} -Werror=incompatible-pointer-types" )
Original file line number Diff line number Diff line change @@ -530,8 +530,6 @@ JS_ENGINES = [NODE_JS]
530
530
<ItemGroup Condition =" '$(TargetsMacCatalyst)' == 'true'" >
531
531
<_MonoCMakeArgs Include =" -DCMAKE_SYSTEM_VARIANT=maccatalyst" />
532
532
<_MonoCMakeArgs Include =" -DBUILD_DARWIN_FRAMEWORKS=1" />
533
- <!-- https://gitlab.kitware.com/cmake/cmake/-/issues/20132 -->
534
- <_MonoCPPFLAGS Include =" -Wno-overriding-t-option" />
535
533
<_MonoCFlags Condition =" '$(TargetArchitecture)' == 'arm64'" Include =" -target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
536
534
<_MonoCFlags Condition =" '$(TargetArchitecture)' == 'x64'" Include =" -target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
537
535
<_MonoCFLAGS Condition =" '$(TargetArchitecture)' == 'arm64'" Include =" -arch arm64" />
You can’t perform that action at this time.
0 commit comments