Skip to content

Commit

Permalink
Fix WASM toolchain check
Browse files Browse the repository at this point in the history
  • Loading branch information
YuAo committed Apr 16, 2022
1 parent 8e0abeb commit 82abc04
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
import Foundation

let isUsingSwiftWASMToolchain = (ProcessInfo.processInfo.environment["TOOLCHAINS"] == "swiftwasm")

let packageDependencies: [Package.Dependency]
#if os(WASI)
packageDependencies = []
#else
packageDependencies = [.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0")]
#endif
if isUsingSwiftWASMToolchain {
packageDependencies = []
} else {
packageDependencies = [.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0")]
}

let metalLibraryArchiveTargetDependencies: [Target.Dependency]
#if os(WASI)
metalLibraryArchiveTargetDependencies = []
#else
metalLibraryArchiveTargetDependencies = [.product(name: "Crypto", package: "swift-crypto")]
#endif
if isUsingSwiftWASMToolchain {
metalLibraryArchiveTargetDependencies = []
} else {
metalLibraryArchiveTargetDependencies = [.product(name: "Crypto", package: "swift-crypto")]
}

let package = Package(
name: "MetalLibraryArchive",
Expand Down

0 comments on commit 82abc04

Please sign in to comment.