Move the iOS picker into a platform folder - #156
Open
martinmitrevski wants to merge 1 commit into
Open
Conversation
UBT excludes source by directory name, not by filename. IOSAttachmentPicker.mm was named for the platform but sat in the module root, so nothing kept it out of a Windows or Linux build: FindInputFilesFromDirectory collects .mm on every platform, and UEBuildModuleCPP then hands InputFiles.MMFiles straight to whichever toolchain is active, MSVC included. Putting it under IOS/ is what the exclusion actually keys on. Every .mm in the engine already lives in a folder named for its platform, and none sit outside one. The module is flat, so a quoted include used to resolve against the including file's own directory. That stops working a directory down, hence the module root on PrivateIncludePaths. Verified: Mac builds without compiling the file at all, and links, because the !PLATFORM_IOS no-op in SampleAttachmentPicker.cpp supplies the two symbols. iOS still compiles it. 47/47 tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #154, which I got wrong.
IOSAttachmentPicker.mmwas named for the platform but sat in the module root. That does not exclude it from anything: UBT excludes source by directory name, andFindInputFilesFromDirectorycollects.mmon every platform, after whichUEBuildModuleCPPhandsInputFiles.MMFilesto whatever toolchain is active. On a Windows build that means handing a.mmto MSVC.The
#if PLATFORM_IOSguard inside the file does not save it, because the problem is the toolchain being asked to compile the file at all, not what the file contains.Putting it under
IOS/is what the exclusion actually keys on (GetExcludedFolderNames()= platform folder names minus the ones included for the current target). Every.mmshipped in the engine already lives in a folder named for its platform, and none sit outside one.The module is flat, so a quoted include resolved against the including file's own directory. That stops working a directory down, hence the module root added to
PrivateIncludePaths.Verified
#if !PLATFORM_IOSno-op inSampleAttachmentPicker.cppsupplies both symbols, which is exactly the arrangement Windows and Linux rely on.IOSAttachmentPicker.mm, now fromIOS/.-NoPCH -NoSharedPCH -DisableUnity), 47/47 tests.I could not build this on Windows, and neither could CI: every
🔌 Buildand🤡 Build samplesjob on #154 sat queued and never ran, so the Win64 check that would have caught this never reported. Worth confirming the self-hosted runners before relying on those checks.🤖 Generated with Claude Code