Different optimization level for package dependencies

I am using DuckDB as an external dependency in my project. The package is basically a Swift wrapper around C++ code.

If I run my app in Debug mode, then the performance of the library is an order of magnitude slower than when I run it in Release mode. In Release mode it is really fast, but compilation times are too slow.

I am a complete beginner to Xcode's build system and was wondering if there was any way to have the best of both worlds? For example, by compiling my SwiftUI code without optimizations but having it linked to a static and optimized version of the library.

Different optimization level for package dependencies
 
 
Q