Skip to content

Commit

Permalink
[iOS] Add temp cindex attribute to build on xcode 15 (#88261)
Browse files Browse the repository at this point in the history
Without CursorKind 437, the cross build for iOS/tvOS and iOS/tvOSSimulator will fail. This change adds a temporary attribute to avoid that.
  • Loading branch information
steveisok authored Jul 5, 2023
1 parent d52b303 commit 68f8f59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/mono/mono/tools/offsets-tool/clang/cindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,8 @@ def __repr__(self):

CursorKind.DLLEXPORT_ATTR = CursorKind(418)
CursorKind.DLLIMPORT_ATTR = CursorKind(419)
# Temporary fake value to work around xcode 15 beta / clang 15
CursorKind.XCODEBETA_ATTR = CursorKind(437)
CursorKind.CONVERGENT_ATTR = CursorKind(438)
CursorKind.WARN_UNUSED_ATTR = CursorKind(439)
CursorKind.WARN_UNUSED_RESULT_ATTR = CursorKind(440)
Expand Down
9 changes: 5 additions & 4 deletions src/tasks/AppleAppBuilder/AppleAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public void ValidateRuntimeSelection()

public override bool Execute()
{
bool shouldStaticLink = true;
bool isDevice = (TargetOS == TargetNames.iOS || TargetOS == TargetNames.tvOS);

ValidateRuntimeSelection();
Expand Down Expand Up @@ -287,9 +288,9 @@ public override bool Execute()
assemblerFilesToLink.Add(nativeDependency);
}

if (!ForceInterpreter && (isDevice || ForceAOT) && (assemblerFiles.Count == 0 && !UseNativeAOTRuntime))
if (!ForceInterpreter && (shouldStaticLink || ForceAOT) && (assemblerFiles.Count == 0 && !UseNativeAOTRuntime))
{
throw new InvalidOperationException("Need list of AOT files for device builds.");
throw new InvalidOperationException("Need list of AOT files for static linked builds.");
}

if (!string.IsNullOrEmpty(DiagnosticPorts))
Expand Down Expand Up @@ -323,7 +324,7 @@ public override bool Execute()
if (GenerateXcodeProject)
{
XcodeProjectPath = generator.GenerateXCode(ProjectName, MainLibraryFileName, assemblerFiles, assemblerDataFiles, assemblerFilesToLink, extraLinkerArgs, excludes,
AppDir, binDir, MonoRuntimeHeaders, !isDevice, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, HybridGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource, UseNativeAOTRuntime);
AppDir, binDir, MonoRuntimeHeaders, !shouldStaticLink, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, HybridGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource, UseNativeAOTRuntime);

if (BuildAppBundle)
{
Expand All @@ -349,7 +350,7 @@ public override bool Execute()
else if (GenerateCMakeProject)
{
generator.GenerateCMake(ProjectName, MainLibraryFileName, assemblerFiles, assemblerDataFiles, assemblerFilesToLink, extraLinkerArgs, excludes,
AppDir, binDir, MonoRuntimeHeaders, !isDevice, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, HybridGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource, UseNativeAOTRuntime);
AppDir, binDir, MonoRuntimeHeaders, !shouldStaticLink, UseConsoleUITemplate, ForceAOT, ForceInterpreter, InvariantGlobalization, HybridGlobalization, Optimized, EnableRuntimeLogging, EnableAppSandbox, DiagnosticPorts, RuntimeComponents, NativeMainSource, UseNativeAOTRuntime);
}

return true;
Expand Down

0 comments on commit 68f8f59

Please sign in to comment.