krisk / fuse-swift

A lightweight fuzzy-search library, with zero dependencies
MIT License
934 stars 112 forks source link

MacOS Support for Carthage #28

Open blakewilson opened 5 years ago

blakewilson commented 5 years ago

Hi there! I was curious if it would be possible for the framework to support MacOS through Carthage? Currently it only builds to IOS.

tohjustin commented 4 years ago

Same here, I wasn't able to import the framework via Carthage on MacOS

Minimal steps to reproduce the issue

❯ mkdir temp && cd temp
❯ echo 'github "krisk/fuse-swift"\n' > Cartfile
❯ carthage update --platform macOS
*** Fetching fuse-swift
*** Checking out fuse-swift at "1.4.0"
*** xcodebuild output can be found in /var/folders/zz/hrtg5njd3ndc12jmlmfg3lzr0000gn/T/carthage-xcodebuild.57kvhC.log
*** Skipped building fuse-swift due to the error:
Dependency "fuse-swift" has no shared framework schemes for any of the platforms: Mac

If you believe this to be an error, please file an issue with the maintainers at https://github.com/krisk/fuse-swift/issues/new

Proposed fix

I was able to fix this by adding a MacOS build target & scheme in the Xcode project: https://github.com/tohjustin/fuse-swift/commit/c2290cefd5ea218b3391db6acaa7bf8f136d9de5

❯ mkdir temp && cd temp
❯ echo 'github "tohjustin/fuse-swift" "c2290ce"\n' > Cartfile
❯ carthage update --platform macOS
❯ tree Carthage/Build
Carthage/Build
└── Mac
    ├── Fuse.framework
    │   ├── Fuse -> Versions/Current/Fuse
    │   ├── Headers -> Versions/Current/Headers
    │   ├── Modules -> Versions/Current/Modules
    │   ├── Resources -> Versions/Current/Resources
    │   └── Versions
    │       ├── A
    │       │   ├── Fuse
    │       │   ├── Headers
    │       │   │   ├── Fuse-Swift.h
    │       │   │   └── Fuse-umbrella.h
    │       │   ├── Modules
    │       │   │   ├── Fuse.swiftmodule
    │       │   │   │   ├── x86_64-apple-macos.swiftdoc
    │       │   │   │   ├── x86_64-apple-macos.swiftmodule
    │       │   │   │   ├── x86_64.swiftdoc
    │       │   │   │   └── x86_64.swiftmodule
    │       │   │   └── module.modulemap
    │       │   └── Resources
    │       │       └── Info.plist
    │       └── Current -> A
    └── Fuse.framework.dSYM
        └── Contents
            ├── Info.plist
            └── Resources
                └── DWARF
                    └── Fuse

16 directories, 12 files

@krisk Can I submit a PR to fix this?