Skip to content

Commit

Permalink
Conditionally apply sse2neon only on arm arch.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Mar 14, 2024
1 parent 1307787 commit f11bfdd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10,109 deletions.
35 changes: 27 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,7 @@ let package = Package(

.target(
name: "OpenColorIO",
dependencies: [
.target(name: "pystring"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "MiniZip"),
.target(name: "Yaml"),
Arch.OS.python(),
],
dependencies: Arch.OS.ocioDeps(),
exclude: getConfig(for: .ocio).exclude,
publicHeadersPath: "include",
cxxSettings: [
Expand Down Expand Up @@ -1367,6 +1360,32 @@ enum Arch
#endif /* os(Linux) || os(Android) || os(OpenBSD) || os(FreeBSD) || os(Windows) || os(Cygwin) || os(WASI) */
}

public static func ocioDeps() -> [Target.Dependency]
{
// only add sse2neon on arm arch.
let sse2neon: [Target.Dependency] = Arch.cpuArch.family.contains(.arm) ? [.target(name: "sse2neon")] : []

#if os(Linux) || os(Android) || os(OpenBSD) || os(FreeBSD)
return [
.target(name: "pystring"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "MiniZip"),
.target(name: "Yaml"),
.target(name: "Python")
] + sse2neon
#else /* os(macOS) || os(visionOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Windows) || os(Cygwin) || os(WASI) */
return [
.target(name: "pystring"),
.target(name: "Imath"),
.target(name: "OpenEXR"),
.target(name: "MiniZip"),
.target(name: "Yaml"),
.product(name: "Python", package: "MetaversePythonFramework", condition: .when(platforms: Arch.OS.apple.platform))
] + sse2neon
#endif /* os(macOS) || os(visionOS) || os(iOS) || os(tvOS) || os(watchOS) || os(Windows) || os(Cygwin) || os(WASI) */
}

public static func python() -> Target.Dependency
{
#if os(macOS) || os(visionOS) || os(iOS) || os(tvOS) || os(watchOS)
Expand Down
Loading

0 comments on commit f11bfdd

Please sign in to comment.