Quoting @NeoNacho (How to exclude a local package from an Xcode target? - #5 by NeoNacho):
The way
canImportworks is if the module exists in your search paths, it'll be true. Typically when using Xcode or SwiftPM, there's just one shared directory for any modules being built, so whether a dependency has been declared won't affect whethercanImportwill return true. Generally speaking, the compiler doesn't know at all about your declared dependencies from the package manifest today.
Yes, platforms defines the minimum deployment target for the listed platforms. Non-mentioned platforms are implicitly included by default (with SwiftPM's default min deployment target, if the concept makes sense for the platform).
As far as I know, there is no way to specify an unsupported platform in a SwiftPM manifest.