tuist / XcodeProj

📝 Read, update and write your Xcode projects
https://xcodeproj.tuist.io
MIT License
2.02k stars 302 forks source link

Cannot find 'Glibc' in scope on Mac #817

Closed paul-brenner closed 5 months ago

paul-brenner commented 5 months ago

Context 🕵️‍♀️

I am trying to use XcodeProj for the ios app I'm building. I added it using SPM by adding a package dependency and pointing it to https://github.com/tuist/XcodeProj.git but in XcodeProj/Extensions/Path+Extras.swift

#if os(macOS)
let systemGlob = Darwin.glob
#else
let systemGlob = Glibc.glob
#endif

I get Cannot find 'Glibc' in scope. Which seems to make sense since I'm compiling for an ios target. I'm sure I'm misunderstanding something very fundamental here either about xcode or XcodeProj. I would have thought this code should be

#if os(Linux)
let systemGlob = Glibc.glob
#else
let systemGlob = Darwin.glob
#endif

is XcodeProj not able to be used for ios projects? Am I just using it incorrectly?

luispadron commented 5 months ago

Which seems to make sense since I'm compiling for an ios target.

AFAIK XcodeProj is a macOS only library so compiling it for iOS is not supported

paul-brenner commented 5 months ago

ah, I am pretty sure I was misunderstanding. I should not be adding this as a dependency to the ios project that I'm trying to control. My mistake