wabiverse / SwiftUSD

Pixar's universal scene description for swift and the open source metaverse.
https://wabiverse.github.io/SwiftUSD/documentation/pixarusd/
Other
66 stars 5 forks source link

Build issue on Xcode 16 #16

Closed giln closed 1 month ago

giln commented 1 month ago

Description of Issue

Steps to Reproduce

  1. I added the package dependency to a project.
  2. When I build I have 10 errors: image

System Information (OS, Hardware)

Mac OS Sequoia Xcode 16

Package Versions

24.8.3

Build Flags

furby-tm commented 1 month ago

Ah, this is because the target you're adding the SwiftUSD dependency to is missing the following in your Package.swift:

.target(
  name: "MyTarget",
  dependencies: [
    .product(name: "PixarUSD", package: "SwiftUSD")
  ],
  swiftSettings: [
    // you are missing this.
    .interoperabilityMode(.Cxx)
  ]
)

Without that line, swift attempts to compile all of the Pixar USD code as C instead of C++.

You will need this line in the swiftSettings array for both library targets as well as executable targets.

Hopefully that clears things up!

giln commented 1 month ago

Ok thanks a lot for your fast answer )

furby-tm commented 1 month ago

Feel free to reach out if you run into anything else!