robreuss / VirtualGameController

Software-based game controllers for iOS, tvOS, OS X and watchOS in Swift 4.2.
MIT License
462 stars 44 forks source link

Cocoapods with platform specific source files #15

Closed Dzamir closed 8 years ago

Dzamir commented 8 years ago

From this discussion: https://github.com/robreuss/VirtualGameController/pull/13#issuecomment-168449733

We need to create a podspec that compiles different files for each platform.

Dzamir commented 8 years ago

I can work on this, I'll let you know

robreuss commented 8 years ago

I took a look around and it seems I already have things setup on iOS, tvOS and OS X to tolerate all of the framework source files being a part of the compiled sources set, and use compiler directives to exclude incompatible files. The exception to this is watchOS, which takes a very small subset of files. Thanks for working on this!

robreuss commented 8 years ago

I have a branch where I've excluded watchOS compilation on non-watch-related source files, so all source files can be included when targeting watchOS. I don't want to step on your work, so let me know if you want me to push that.

Also, I've tested building a multi-platform framework and it seems to work well (i.e. a single framework file that can be added to any platform-specific target). I don't think it has much relevance for building better Cocoapod support, because Cocoapods would be implicitly compiling for the correct platform, correct?

Dzamir commented 8 years ago

I still haven't started working on it: you can push without problems.

I also don't think that the framework strategy is important with Cocoapods, because it already compiles from the source code as a framework for each platform.

robreuss commented 8 years ago

Will do. I'm working on Carthage support.

robreuss commented 8 years ago

Now Carthage compatible. Swift Package Manager next!

robreuss commented 8 years ago

Added Travis CI.