-
-
Notifications
You must be signed in to change notification settings - Fork 58
chore: Remove -mno-thumb from Xcode projects for unity-of-bugs
#1921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
480b3b1
added post process to remove deprecated optoin
bitsandfoxes 76d3c63
?
bitsandfoxes 3817247
rev
bitsandfoxes 7d1af1a
only on 2020 and older and only for iOS
bitsandfoxes fdd1f29
Format code
getsentry-bot 968bb61
exclude editor scripts for samples
bitsandfoxes 2baa488
Merge branch 'chore/sample-no-thumb-update' of https://github.com/get…
bitsandfoxes 7195256
wrong editor
bitsandfoxes c38b8f6
moved fixer from scripts to editor
bitsandfoxes ff87e96
updated 'pack'
bitsandfoxes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
samples/unity-of-bugs/Assets/Editor/XcodeProjectUpdater.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #if UNITY_IOS && !UNITY_2021_1_OR_NEWER | ||
| using UnityEditor; | ||
| using UnityEditor.Callbacks; | ||
| using UnityEditor.iOS.Xcode; | ||
| using UnityEngine; | ||
|
|
||
| namespace Editor | ||
| { | ||
| /// <summary> | ||
| /// Unity adds the '-mno-thumb' compiler flag by default to iOS builds, but this flag is outdated | ||
| /// and no longer supported by modern versions of Xcode. Leaving this flag in the project will cause | ||
| /// Xcode builds to fail with an "unsupported option '-mno-thumb' for target" error. This post-process | ||
| /// build step removes the flag to ensure the sample works on all versions of Unity. | ||
| /// </summary> | ||
| public static class XcodeProjectUpdater | ||
| { | ||
| [PostProcessBuild] | ||
| public static void OnPostProcessBuild(BuildTarget target, string pathToBuildProject) | ||
| { | ||
| if (target != BuildTarget.iOS) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| Debug.Log("XcodeUpdater.OnPostProcessBuild started."); | ||
|
|
||
| var pbxProjectPath = PBXProject.GetPBXProjectPath(pathToBuildProject); | ||
| var project = new PBXProject(); | ||
| project.ReadFromFile(pbxProjectPath); | ||
|
|
||
| var targetGuid = project.GetUnityMainTargetGuid(); | ||
|
|
||
| Debug.Log("Removing '-mno-thumb' from 'OTHER_CFLAGS'."); | ||
| project.UpdateBuildProperty(targetGuid, "OTHER_CFLAGS", null, new[] { "-mno-thumb" }); | ||
|
|
||
| project.WriteToFile(pbxProjectPath); | ||
|
|
||
| Debug.Log("XcodeUpdater.OnPostProcessBuild finished."); | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
11 changes: 11 additions & 0 deletions
11
samples/unity-of-bugs/Assets/Editor/XcodeProjectUpdater.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ Copy-Item "LICENSE.md" -Destination "package-release/LICENSE.md" | |
|
|
||
| # Copy samples | ||
| Copy-Item "samples/unity-of-bugs/Assets/Scenes*" -Destination "package-release/Samples~/unity-of-bugs/" -Recurse | ||
| Copy-Item "samples/unity-of-bugs/Assets/Editor*" -Destination "package-release/Samples~/unity-of-bugs/" -Recurse | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had nothing there in the first place. |
||
| Copy-Item "samples/unity-of-bugs/Assets/Scripts*" -Destination "package-release/Samples~/unity-of-bugs/" -Recurse | ||
|
|
||
| # Create zip | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logger doesn't let us opt out or set level right? are we not using our logger here why?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a script that lives outside the SDK and is not part of the shipped package.
It's is purely there to help us run builds locally, when targeting iOS on old Unity versions.