File tree Expand file tree Collapse file tree
nativeaot/BuildIntegration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,19 @@ The .NET Foundation licenses this file to you under the MIT license.
166166 <LinkerArg Include =" -Wl,--eh-frame-hdr" Condition =" '$(_IsApplePlatform)' != 'true'" />
167167 </ItemGroup >
168168
169+ <Exec Command =" xcodebuild -version" Condition =" '$(_IsApplePlatform)' == 'true'" IgnoreExitCode =" true" StandardOutputImportance =" Low" ConsoleToMSBuild =" true" >
170+ <Output TaskParameter =" ExitCode" PropertyName =" _XcodeVersionStringExitCode" />
171+ <Output TaskParameter =" ConsoleOutput" PropertyName =" _XcodeVersionString" />
172+ </Exec >
173+
174+ <PropertyGroup Condition =" ('$(_XcodeVersionStringExitCode)' == '0' or '$(_XcodeVersionStringExitCode)' == '1') and '$(_XcodeVersionString)' != ''" >
175+ <_XcodeVersion >$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*'))</_XcodeVersion >
176+ </PropertyGroup >
177+
178+ <ItemGroup Condition =" '$(UseLdClassicXCodeLinker)' != 'false' and '$(_IsApplePlatform)' == 'true'" >
179+ <CustomLinkerArg Condition =" '$(_XcodeVersion)' > = '15'" Include =" -ld_classic" />
180+ </ItemGroup >
181+
169182 <PropertyGroup >
170183 <_CommandProbe >command -v</_CommandProbe >
171184 <_CommandProbe Condition =" $([MSBuild]::IsOSPlatform('Windows'))" >where /Q</_CommandProbe >
Original file line number Diff line number Diff line change 7070 <Output TaskParameter =" ConsoleOutput" PropertyName =" _CC_LDFLAGS" />
7171 </Exec >
7272
73+ <Exec Command =" xcodebuild -version" Condition =" '$(_IsApplePlatform)' == 'true'" IgnoreExitCode =" true" StandardOutputImportance =" Low" ConsoleToMSBuild =" true" >
74+ <Output TaskParameter =" ExitCode" PropertyName =" _XcodeVersionStringExitCode" />
75+ <Output TaskParameter =" ConsoleOutput" PropertyName =" _XcodeVersionString" />
76+ </Exec >
77+
78+ <PropertyGroup Condition =" ('$(_XcodeVersionStringExitCode)' == '0' or '$(_XcodeVersionStringExitCode)' == '1') and '$(_XcodeVersionString)' != ''" >
79+ <_XcodeVersion >$([System.Text.RegularExpressions.Regex]::Match($(_XcodeVersionString), '[1-9]\d*'))</_XcodeVersion >
80+ </PropertyGroup >
81+
82+ <ItemGroup Condition =" '$(NativeAotSupported)' == 'true' and '$(_IsApplePlatform)' == 'true'" >
83+ <CustomLinkerArg Condition =" '$(_XcodeVersion)' > = '15'" Include =" -ld_classic" />
84+ </ItemGroup >
85+
7386 <PropertyGroup >
7487 <CppLinker >$(_CC_LDFLAGS.SubString(0, $(_CC_LDFLAGS.IndexOf(';'))))</CppLinker >
7588 <_LDFLAGS >$(_CC_LDFLAGS.SubString($([MSBuild]::Add($(_CC_LDFLAGS.IndexOf(';')), 1))))</_LDFLAGS >
You can’t perform that action at this time.
0 commit comments