diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d79fc1..17f2971 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,4 +43,16 @@ jobs: - name: Test run: swift test --skip-update --parallel --enable-test-discovery - name: Build Release - run: swift build -c release \ No newline at end of file + run: swift build -c release + + webAssembly: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Swift version + run: swift --version + - name: Build + uses: swiftwasm/swiftwasm-action@master + with: + shell-action: swift build --triple wasm32-unknown-wasi diff --git a/README.md b/README.md index d1b5544..11a4935 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![swift version](https://img.shields.io/badge/swift-5.1+-brightgreen.svg)](https://swift.org) [![platforms](https://img.shields.io/badge/platforms-%20macOS%20|%20iOS%20|%20tvOS%20|%20watchOS-brightgreen.svg)](#) [![platforms](https://img.shields.io/badge/platforms-linux-brightgreen.svg)](#) +[![platforms](https://img.shields.io/badge/platforms-WebAssembly-brightgreen.svg)](https://github.com/swiftwasm/swift#swiftwasm) [![codecov](https://codecov.io/gh/fireblade-engine/ecs/branch/master/graph/badge.svg)](https://codecov.io/gh/fireblade-engine/ecs) [![documentation](https://github.com/fireblade-engine/ecs/workflows/Documentation/badge.svg)](https://github.com/fireblade-engine/ecs/wiki) diff --git a/Sources/FirebladeECS/Foundation+Extensions.swift b/Sources/FirebladeECS/Foundation+Extensions.swift index d18fc33..c7ff0cf 100644 --- a/Sources/FirebladeECS/Foundation+Extensions.swift +++ b/Sources/FirebladeECS/Foundation+Extensions.swift @@ -6,15 +6,8 @@ // #if canImport(Foundation) -import class Foundation.JSONEncoder -import class Foundation.JSONDecoder - -import class Foundation.PropertyListEncoder -import class Foundation.PropertyListDecoder +import Foundation extension JSONEncoder: TopLevelEncoder { } extension JSONDecoder: TopLevelDecoder { } - -extension PropertyListEncoder: TopLevelEncoder { } -extension PropertyListDecoder: TopLevelDecoder { } #endif diff --git a/Sources/FirebladeECS/Hashing.swift b/Sources/FirebladeECS/Hashing.swift index 29b228d..f9d4f2e 100644 --- a/Sources/FirebladeECS/Hashing.swift +++ b/Sources/FirebladeECS/Hashing.swift @@ -7,7 +7,7 @@ #if arch(x86_64) || arch(arm64) || arch(powerpc64) || arch(powerpc64le) || arch(s390x) // 64 bit private let kFibA: UInt = 0x9e3779b97f4a7c15 // = 11400714819323198485 aka Fibonacci Hash a value for 2^64; calculate by: 2^64 / (golden ratio) -#elseif arch(i386) || arch(arm) || os(watchOS) // 32 bit +#elseif arch(i386) || arch(arm) || os(watchOS) || arch(wasm32) // 32 bit private let kFibA: UInt = 0x9e3779b9 // = 2654435769 aka Fibonacci Hash a value for 2^32; calculate by: 2^32 / (golden ratio) #else #error("unsupported architecture")