From e6eb54c7e9a41f2d63b5fd82300cfe4e578e1ac8 Mon Sep 17 00:00:00 2001 From: Farshad Sheykhi Date: Mon, 15 Apr 2024 13:11:08 -0700 Subject: [PATCH] Fix build for tvOS --- Sources/RealityGeometries/CompleteVertex.swift | 2 ++ Sources/RealityGeometries/MeshResource+Extensions.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Cone.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Cylinder.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Path.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Planes.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Torus.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+TorusArc.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Tube.swift | 2 ++ Sources/RealityGeometries/RealityGeometry+Wedge.swift | 2 ++ 10 files changed, 20 insertions(+) diff --git a/Sources/RealityGeometries/CompleteVertex.swift b/Sources/RealityGeometries/CompleteVertex.swift index 5acbcea..31b37d8 100644 --- a/Sources/RealityGeometries/CompleteVertex.swift +++ b/Sources/RealityGeometries/CompleteVertex.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 12/06/2021. // +#if canImport(RealityKit) import RealityKit internal struct CompleteVertex { @@ -36,3 +37,4 @@ internal extension Array where Element == CompleteVertex { return meshDescriptor } } +#endif diff --git a/Sources/RealityGeometries/MeshResource+Extensions.swift b/Sources/RealityGeometries/MeshResource+Extensions.swift index 40dda44..a0604a1 100644 --- a/Sources/RealityGeometries/MeshResource+Extensions.swift +++ b/Sources/RealityGeometries/MeshResource+Extensions.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 14/03/2023. // +#if canImport(RealityKit) import RealityKit public extension MeshResource { @@ -54,3 +55,4 @@ public extension MeshResource { @available(*, deprecated, renamed: "RealityGeometry.PathProperties") typealias PathProperties = RealityGeometry.PathProperties } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Cone.swift b/Sources/RealityGeometries/RealityGeometry+Cone.swift index f73f536..783b863 100644 --- a/Sources/RealityGeometries/RealityGeometry+Cone.swift +++ b/Sources/RealityGeometries/RealityGeometry+Cone.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 12/06/2021. // +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -163,3 +164,4 @@ extension RealityGeometry { ) } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Cylinder.swift b/Sources/RealityGeometries/RealityGeometry+Cylinder.swift index 987046f..136e18d 100644 --- a/Sources/RealityGeometries/RealityGeometry+Cylinder.swift +++ b/Sources/RealityGeometries/RealityGeometry+Cylinder.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 12/06/2021. // +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -179,3 +180,4 @@ extension RealityGeometry { ) } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Path.swift b/Sources/RealityGeometries/RealityGeometry+Path.swift index 7a77011..6a01dc1 100644 --- a/Sources/RealityGeometries/RealityGeometry+Path.swift +++ b/Sources/RealityGeometries/RealityGeometry+Path.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 15/10/2021. // +#if canImport(RealityKit) import RealityKit import CoreGraphics import os @@ -229,3 +230,4 @@ fileprivate extension SIMD3 where SIMD3.Scalar: Comparable { return SIMD3(self.x, 0, self.z) } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Planes.swift b/Sources/RealityGeometries/RealityGeometry+Planes.swift index b78b284..629f2d7 100644 --- a/Sources/RealityGeometries/RealityGeometry+Planes.swift +++ b/Sources/RealityGeometries/RealityGeometry+Planes.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 11/06/2021. // +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -45,3 +46,4 @@ extension RealityGeometry { return try .generate(from: [descr]) } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Torus.swift b/Sources/RealityGeometries/RealityGeometry+Torus.swift index 21ee407..fe28788 100644 --- a/Sources/RealityGeometries/RealityGeometry+Torus.swift +++ b/Sources/RealityGeometries/RealityGeometry+Torus.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 25/10/2021. // +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -85,3 +86,4 @@ extension RealityGeometry { return allVertices } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+TorusArc.swift b/Sources/RealityGeometries/RealityGeometry+TorusArc.swift index 4c2c351..fa9349b 100644 --- a/Sources/RealityGeometries/RealityGeometry+TorusArc.swift +++ b/Sources/RealityGeometries/RealityGeometry+TorusArc.swift @@ -5,6 +5,7 @@ // Created by Shawn Coumbe on 12/03/2023. // Based on code by Max Cobb +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -166,3 +167,4 @@ extension RealityGeometry { return allVertices } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Tube.swift b/Sources/RealityGeometries/RealityGeometry+Tube.swift index dcfb413..f153e8d 100644 --- a/Sources/RealityGeometries/RealityGeometry+Tube.swift +++ b/Sources/RealityGeometries/RealityGeometry+Tube.swift @@ -5,6 +5,7 @@ // Created by Max Cobb on 13/03/2023. // +#if canImport(RealityKit) import Foundation import RealityKit @@ -174,3 +175,4 @@ public extension RealityGeometry { } } +#endif diff --git a/Sources/RealityGeometries/RealityGeometry+Wedge.swift b/Sources/RealityGeometries/RealityGeometry+Wedge.swift index e191b25..7b80b4d 100644 --- a/Sources/RealityGeometries/RealityGeometry+Wedge.swift +++ b/Sources/RealityGeometries/RealityGeometry+Wedge.swift @@ -5,6 +5,7 @@ // Created by Shawn Coumbe on 12/03/2023 // Based on code by Max Cobb +#if canImport(RealityKit) import RealityKit extension RealityGeometry { @@ -214,3 +215,4 @@ extension RealityGeometry { ) } } +#endif